Files
swift-mirror/test/Serialization/Inputs/alias.swift
Pavel Yaskevich 7ed3d754b5 [Serialization] Allow unbound generic types to cross-reference typealias decls
Ideally `UnboundGenericType` should never be serialized but it is
currently allowed to make generic `typealias` declarations without
specifying generic parameters, so it should be allowed to cross
reference typealias decls in such types as well because `NameAliasType`
can't be used until generic parameters are resolved.

This is only a temporary fix and more comprehensive solution is still
pending here, most likely such declarations should not produce
`UnboundGenericType` but instead should copy generic parameters from
underlying type and produce proper `NameAliasType`.

Resolves: rdar://problem/37384120
2018-05-22 18:17:21 -07:00

42 lines
971 B
Swift

public typealias MyInt64 = Int64
public typealias AnotherInt64 = (MyInt64)
public typealias TwoInts = (MyInt64, Int64)
public typealias ThreeNamedInts = (a : MyInt64, b : MyInt64, c : MyInt64)
public typealias None = ()
public typealias NullFunction = () -> ()
public typealias IntFunction = (MyInt64) -> MyInt64
public typealias TwoIntFunction = (TwoInts) -> MyInt64
public struct AliasWrapper {
public typealias Boolean = Bool
}
public extension Int {
public typealias EspeciallyMagicalInt = Int64
}
public typealias IntSlice = [Int]
public struct Base {
public func foo() -> BaseAlias {
return self
}
}
public typealias BaseAlias = Base
public protocol ProtoWrapper {}
extension ProtoWrapper {
public typealias Boolean = Bool
}
public struct Outer { public typealias G<T> = T }
public typealias GG = Outer.G
public typealias GInt = Outer.G<Int>
public struct UnboundStruct<T> {}
public typealias UnboundAlias<T: Comparable> = UnboundStruct<T>