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:
@@ -12,11 +12,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("AnnotationsOnTypeAliasesKt").assertHasDeclaredMethodWithAnn()
|
||||
Class.forName("C").assertHasDeclaredMethodWithAnn()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
class Cell<TC>(val x: TC)
|
||||
|
||||
object OkHost {
|
||||
val value = "OK"
|
||||
}
|
||||
|
||||
fun <T> id(x: T): T {
|
||||
typealias C = Cell<T>
|
||||
val c: C = C(x)
|
||||
return c.x
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
typealias OK = OkHost
|
||||
return id(OK.value)
|
||||
}
|
||||
Reference in New Issue
Block a user