// 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()) // expected-warning{{unused}} GInt().foo(GChar()) GInt().bar(0) GInt.static_foo(GChar()) GInt.static_bar(0) // struct AnyStream { struct StreamRange { // expected-error{{generic type 'StreamRange' nested in type 'AnyStream' is not allowed}} var index : Int var elements : S // Conform to the IteratorProtocol protocol. typealias Element = (Int, S.Element) mutating func next() -> Element? { let result = (index, elements.next()) if result.1 == nil { return .none } index += 1 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.makeIterator()) } } func enumerate(arg: T) -> AnyStream { return AnyStream(input: arg) }