File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -2246,7 +2246,7 @@ namespace {
2246
2246
Type subPatternType = getTypeForPattern (
2247
2247
subPattern,
2248
2248
locator.withPathElement (LocatorPathElt::PatternMatch (subPattern)),
2249
- openedType, bindPatternVarsOneWay);
2249
+ openedType, /* bindPatternVarsOneWay*/ false );
2250
2250
2251
2251
if (!subPatternType)
2252
2252
return Type ();
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5
2
+
3
+ // REQUIRES: OS=macosx
4
+
5
+ enum Category {
6
+ case first
7
+ }
8
+
9
+ protocol View { }
10
+
11
+ extension View {
12
+ func test( _ tag: Category ) -> some View {
13
+ Image ( )
14
+ }
15
+ }
16
+
17
+ @resultBuilder struct ViewBuilder {
18
+ static func buildBlock< Content> ( _ content: Content ) -> Content where Content : View { fatalError ( ) }
19
+ }
20
+
21
+ struct Image : View {
22
+ }
23
+
24
+ struct MyView {
25
+ @ViewBuilder var body : some View {
26
+ let icon : Category ! = Category . first // expected-error {{using '!' is not allowed here; perhaps '?' was intended?}} {{23-24=?}}
27
+ Image ( ) . test ( icon)
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments