Report error on non-top-level type aliases (unsupported in 1.1).
Get rid of nested type aliases in project.
This commit is contained in:
@@ -9,11 +9,6 @@ import java.lang.Class
|
||||
@Retention(RUNTIME)
|
||||
annotation class Ann(val x: Int)
|
||||
|
||||
class C {
|
||||
@Ann(1)
|
||||
typealias TA = Any
|
||||
}
|
||||
|
||||
@Ann(2)
|
||||
typealias TA = Any
|
||||
|
||||
@@ -28,7 +23,6 @@ fun Class<*>.assertHasDeclaredMethodWithAnn() {
|
||||
|
||||
fun box(): String {
|
||||
Class.forName("a.AKt").assertHasDeclaredMethodWithAnn()
|
||||
Class.forName("a.C").assertHasDeclaredMethodWithAnn()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
// FILE: A.kt
|
||||
class Foo<out T>(val t: T) {
|
||||
typealias Bar = (T) -> String
|
||||
typealias Bar<T> = (T) -> String
|
||||
|
||||
fun baz(b: Bar) = b(t)
|
||||
class Foo<out T>(val t: T) {
|
||||
|
||||
fun baz(b: Bar<T>) = b(t)
|
||||
}
|
||||
|
||||
// FILE: B.kt
|
||||
class FooTest {
|
||||
fun baz(): String {
|
||||
val b: Foo<String>.Bar = { "OK" }
|
||||
val b: Bar<String> = { "OK" }
|
||||
return Foo("").baz(b)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user