// RUN: %target-parse-verify-swift struct G { init() {} init(x:G) { } func foo(x: G) { } func bar(x: U) { } static func static_foo(x: G) { } static func static_bar(x: U) { } } typealias GInt = G typealias GChar = G GInt(x: GChar()) GInt().foo(GChar()) GInt().bar(0) GInt.static_foo(GChar()) GInt.static_bar(0) // struct AnyStream { struct StreamRange { // expected-error{{generic type 'StreamRange' nested}} var index : Int var elements : S // Conform to the GeneratorType protocol. typealias Element = (Int, S.Element) mutating func next() -> Element? { var result = (index, elements.next()) if result.1 == nil { return .None } ++index return (result.0, result.1!) } } var input : T // Conform to the enumerable protocol. typealias Elements = StreamRange func getElements() -> Elements { return Elements(index: 0, elements: input.generate()) } } func enumerate(arg: T) -> AnyStream { return AnyStream(input: arg) }