Commit Graph

4 Commits

Author SHA1 Message Date
Anthony Latsis
f76f6acbf0 Revert "Sema: Emit diagnostics when walking into collection literals with defaulted types"
This reverts commit f608802cfe.
2023-04-20 21:55:40 +03:00
Sima Nerush
f608802cfe Sema: Emit diagnostics when walking into collection literals with defaulted types
Resolves https://github.com/apple/swift/issues/60011

Gardening: clean up `checkTypeDefaultedCollectionExpr` function
2022-08-15 22:45:21 -06:00
Joe Groff
64c1737211 Sema: Clear the types of exprs changed by collection upcast peepholes.
`finish{Array,Dictionary}Expr` currently invoke `cs.cacheExprTypes` after building their semantic exprs, which in a nested collection expression, immediately undoes the type changes done by this peephole, leading to crashes due to inconsistencies in the AST later. rdar://problem/41040820
2018-07-02 15:00:30 -07:00
Joe Groff
194f1f808b Sema: Force the 'getElements' array of a type-checked ArrayExpr to contain rvalues.
There are other parts of CSApply that attempt to peephole transform ArrayExprs (particularly bridging, which tries to turn `[x, y, ...] as T` into `[x as T, y as T, ...]`) and expect the elements to have already been rvalue-d. Fixes rdar://problem/40859007.
2018-06-14 12:08:44 -07:00