mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Introduce new syntax for parsing arbitrary integer literal expressions for generic value arguments: ```swift InlineArray<(<Expr>), T> [(<Expr>) of T] ``` Which, for now, will co-exist alongside the current syntax of simple integer literals. Replace `IntegerTypeRepr` with `GenericArgumentExprTypeRepr`, a new `TypeRepr` node that wraps arbitrary expressions in generic argument positions (e.g., `InlineArray<(1 + 3), Int>`). The node tracks resolution state, distinguishing whether the expression resolved to a type or an integer value. Key changes: - Parse parenthesized generic arguments as expressions - Recover and distinguish types from integer expressions in `resolveGenericArgumentExprTypeRepr`. - When the `LiteralExpressions` feature is enabled, type-check and constant-fold expressions to integer values - Extract `PreCheckTarget` into a public header to expose `simplifyTypeExpr` for use during type resolution Resolves rdar://168005391