Skip to content

Commit bb5fb2e

Browse files
committed
[NFC] Add a test for @_implements with non-identifier type argument
This also ensures that the new Swift parser can handle it too.
1 parent 8f3d48f commit bb5fb2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/attr/attr_implements.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
protocol P {
55
func f0() -> Int;
6+
func f1() -> Int
67
func f(x:Int, y:Int) -> Int;
78
}
89

@@ -19,6 +20,12 @@ struct S : P, Q, Equatable {
1920
return 10
2021
}
2122

23+
// Test that we can handle a non-identifier type that canonicalizes
24+
// to a protocol.
25+
@_implements((P), f1())
26+
func g1() -> Int { 11 }
27+
28+
2229
// Test that it's possible to implement two different protocols with the
2330
// same-named requirements.
2431
@_implements(P, f(x:y:))

0 commit comments

Comments
 (0)