We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38a6726 commit bdd6bfdCopy full SHA for bdd6bfd
test/type/parameterized_existential.swift
@@ -92,8 +92,14 @@ func protocolCompositionNotSupported1(_: SomeProto & Sequence<Int>) {}
92
func protocolCompositionNotSupported2(_: any SomeProto & Sequence<Int>) {}
93
// expected-error@-1 {{non-protocol, non-class type 'Sequence<Int>' cannot be used within a protocol-constrained type}}
94
95
-func increment(n : any Sequence<Float>) {
+func increment(_ n : any Collection<Float>) {
96
for value in n {
97
_ = value + 1
98
}
99
100
+
101
+func genericIncrement<T: Numeric>(_ n : any Collection<T>) {
102
+ for value in n {
103
+ _ = value + 1
104
+ }
105
+}
0 commit comments