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 db3f708 commit 329e2c5Copy full SHA for 329e2c5
test/Generics/where_clause_contextually_generic_decls.swift
@@ -1,5 +1,14 @@
1
// RUN: %target-typecheck-verify-swift -typecheck %s -verify -swift-version 4
2
3
+// Make sure Self: ... is correctly diagnosed in classes
4
+
5
+class SelfInGenericClass<T> {
6
+ // expected-error@+1 {{type 'Self' in conformance requirement does not refer to a generic parameter or associated type}}
7
+ func foo() where Self: Equatable { }
8
+ // expected-error@+1 {{generic signature requires types 'Self' and 'Bool' to be the same}}
9
+ func bar() where Self == Bool { }
10
+}
11
12
protocol Whereable {
13
associatedtype Assoc
14
associatedtype Bssoc
0 commit comments