Files
swift-mirror/test/decl/protocol/req/recursion.swift
Doug Gregor 6af6048c0c AST printing: take more care to only escape 'Self' when needed.
Cleans up AST printing somewhat as well as providing slightly better
type-to-declaration mappings for annotated AST printing and indexing.

Swift SVN r32420
2015-10-03 05:13:52 +00:00

19 lines
550 B
Swift

// RUN: %target-parse-verify-swift
protocol SomeProtocol {
typealias T
}
extension SomeProtocol where T == Optional<T> { } // expected-error{{same-type constraint 'Self.T' == 'Optional<Self.T>' is recursive}}
// rdar://problem/20000145
public protocol P {
typealias T
}
public struct S<A: P where A.T == S<A>> {}
// rdar://problem/19840527
class X<T where T == X> { // expected-error{{same-type requirement makes generic parameter 'T' non-generic}}
var type: T { return self.dynamicType } // expected-error{{use of undeclared type 'T'}}
}