IDE: Visual Studio X/Fire
Version: 10.0.0.2489 (develop)
Target (If relevant): Island(OSX)
Description:
In Apple Swift, within an extension of a generic type alias, the name the underlying type of the type alias used for the generic parameter is visible.
In Silver, however, within an extension of a generic type alias, the name the alias used for the generic parameter is visible.
Honestly, I think Silver’s behavior is better, so I have no idea what to suggest, other than documenting the difference.
Actual Behavior:
Shown in each version:
A: Compiles in Silver, Errors in Swift
B: Compiles in Swift, Errors in Silver
C: Compiles in Both
Version A:
// Good in Elements Silver
struct Str<B> {
}
typealias OuterAlias<Base> = Str<Base>
extension OuterAlias {
typealias InnerAlias = OuterAlias<Base>
// <source>:9:39: error: use of undeclared type 'Base'
// typealias InnerAlias = OuterAlias<Base>
// ^~~~
// Compiler returned: 1
}
Version B:
// Good in Apple Swift
struct Str<Base> {
}
typealias OuterAlias<B> = Str<B>
extension OuterAlias {
typealias InnerAlias = OuterAlias<Base> // E28 Unknown type "Base"
}
Version C:
// Good in Both
struct Str<Base> {
}
typealias OuterAlias<Base> = Str<Base>
extension OuterAlias {
typealias InnerAlias = OuterAlias<Base>
}