mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Pattern resolution currently invokes type resolution with this flag since it's trying to see if it can treat a given expression as a TypeRepr for e.g an enum pattern. Make sure we don't `setInvalid` on such TypeRepr nodes since that will avoid diagnosing in cases where the node also then gets treated as a TypeRepr for an ExprPattern, where we actually want the diagnostic emitted.
11 lines
465 B
Swift
11 lines
465 B
Swift
// {"kind":"typecheck","original":"b7a10f72","signature":"(anonymous namespace)::Verifier::walkToExprPre(swift::Expr*)","signatureAssert":"Assertion failed: ((HadError || !isa<SourceFile *>(M) || cast<SourceFile *>(M)->ASTStage < SourceFile::TypeChecked) && \"OverloadedDeclRef\" \"in wrong phase\"), function walkToExprPre"}
|
|
// RUN: not %target-swift-frontend -typecheck %s
|
|
func a(b : Int) {
|
|
_ = {
|
|
switch b {
|
|
case Optional<c>.d :
|
|
break
|
|
}
|
|
}
|
|
}
|