# Changelog
## v0.2.1 (2025-07-20)
### Bug Fixes
#### 优先级修复:`^` 右侧 `-` 被内部消化 (BUG-1)
- **问题**:`HashMap^K-V` 被解析为 `HashMap^(K-V)` = `HashMap<K<V>>`,违反 `^` > `-` 优先级规则
- **修复**:`expand_caret` 中将右侧在第一个顶层 `-` 处分割,确保 `^` 优先级高于 `-`
- **结果**:`HashMap^K-V` = `(HashMap^K)-V` = `HashMap<K>-V` = `HashMap<K, V>`
- **注意**:`Box^Vec-u32` 是错误写法,应写为 `Box^Vec^u32`
#### `parse_target_items` 丢弃 `<>` 之后内容 (BUG-2)
- **问题**:`HashMap^<u32>-String` 中 `-String` 被静默丢弃
- **根因**:`parse_balanced` 返回的 `pos`(`>` 之后位置)被丢弃
- **修复**:当 `<>` 之后还有内容时,返回整个序列为 `Single`
#### `expand_single` 中 Attribute/Unsafe 前缀未过滤 (BUG-3)
- **问题**:`unsafe^#[attr]^T` 编译错误 "属性 ^ 的内部错误"
- **根因**:`expand_single` 未过滤 `Attribute`/`Unsafe` 前缀,直接传给 `apply_caret`
- **修复**:在调用 `apply_caret` 前过滤 `Attribute`/`Unsafe` 前缀
#### fn 类型优先级修复
- **问题**:`fn^(u32,i32)-usize` 生成 `fn(u32,i32,usize)` 而非 `fn(u32,i32)->usize`
- **修复**:`fn` 前缀应用后,`-` 应作为返回类型而非参数追加
- **结果**:`fn^(u32,i32)-usize` = `fn(u32,i32)->usize`
#### 嵌套 caret + fn 前缀修复
- **问题**:`fn^(u32,i32)^i64-usize` 中 `Fn` 前缀丢失
- **修复**:嵌套 caret 递归展开时,保留 `Fn` 前缀应用
### Code Quality
- 添加 `ImplSpec::new()` 构造器,消除重复的 `attributes: vec![]` 和 `is_unsafe: false` 初始化
- 拆分 `expand_caret` 中 bracket 展开逻辑为 `expand_bracket_with_comma` 和 `expand_nested_bracket`
- 拆分 `dash_append` 中 fn 处理逻辑为 `dash_append_fn_keyword` 和 `dash_append_fn_type`
- 添加 `#![allow(linker_messages)]` 抑制 Windows MSVC 链接器警告
## v0.2.0
初始版本,包含:
- `#[batch_impl]` 属性宏
- `batch_trait!` 函数式宏
- `^` 运算符(右结合)
- `-` 运算符(左结合)
- 元组生成、笛卡尔积、范围语法
- 泛型控制、关联类型绑定、fn 类型支持
- unsafe impl、属性支持