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() {
16431643
16441644 // If the tuple element starts with "ident :", then it is followed
16451645 // by a type annotation.
1646- if (Tok.canBeArgumentLabel () &&
1647- (peekToken ().is (tok::colon) || peekToken ().canBeArgumentLabel ())) {
1646+ if (startsParameterName (/* isClosure=*/ false )) {
16481647 consumeToken ();
16491648 if (Tok.canBeArgumentLabel ()) {
16501649 consumeToken ();
Original file line number Diff line number Diff line change @@ -320,3 +320,12 @@ func testNestedMetatype() {
320320 let _: ( any ( P . Type ) ) . Type = ( any P . Type ) . self
321321 let _: ( ( any ( P . Type ) ) ) . Type = ( any P . Type ) . self
322322}
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