mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
- Enhance PBD with a whereExpr/elseStmt field to hold this. - Start parsing the pattern of let/var decls as a potentially refutable pattern. It becomes a semantic error to use a refutable pattern without an 'else' (diagnostics not in place yet). - Change validatePatternBindingDecl to use 'defer' instead of a goto to ensure cleanups on exit. - Have it resolve the pattern in a PBD, rewriting it from expressions into pattern nodes when valid. - Teach resolvePattern to handle TypedPatterns now that they can appear (wrapping) refutable patterns. - Teach resolvePattern to handle refutable patterns in PBD's without initializers by emitting a diagnostic instead of by barfing, fixing regressions on validation tests my previous patch caused, and fixing two existing validation test crashers. Sema, silgen, and more tests coming later. Swift SVN r26706
12 lines
295 B
Swift
12 lines
295 B
Swift
// RUN: not %target-swift-frontend %s -parse
|
|
|
|
// Distributed under the terms of the MIT license
|
|
// Test case submitted to project by https://github.com/practicalswift (practicalswift)
|
|
// Test case found by fuzzing
|
|
|
|
import Foundation
|
|
struct B<A, T where T : B, i("[0x31] == B
|
|
if c {
|
|
}
|
|
var b[B) {
|