File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1643,8 +1643,7 @@ bool Parser::canParseTypeTupleBody() {
1643
1643
1644
1644
// If the tuple element starts with "ident :", then it is followed
1645
1645
// by a type annotation.
1646
- if (Tok.canBeArgumentLabel () &&
1647
- (peekToken ().is (tok::colon) || peekToken ().canBeArgumentLabel ())) {
1646
+ if (startsParameterName (/* isClosure=*/ false )) {
1648
1647
consumeToken ();
1649
1648
if (Tok.canBeArgumentLabel ()) {
1650
1649
consumeToken ();
Original file line number Diff line number Diff line change @@ -320,3 +320,12 @@ func testNestedMetatype() {
320
320
let _: ( any ( P . Type ) ) . Type = ( any P . Type ) . self
321
321
let _: ( ( any ( P . Type ) ) ) . Type = ( any P . Type ) . self
322
322
}
323
+
324
+ func testEnumAssociatedValue( ) {
325
+ enum E {
326
+ case c1( ( any HasAssoc ) -> Void )
327
+ // expected-error@+1 {{use of protocol 'HasAssoc' as a type must be written 'any HasAssoc'}}
328
+ case c2( ( HasAssoc ) -> Void )
329
+ case c3( ( P ) -> Void )
330
+ }
331
+ }
You can’t perform that action at this time.
0 commit comments