Forbid Foo<T>.Bar
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
|
||||
|
||||
class Foo<T> {
|
||||
class Bar<X> {
|
||||
class Baz {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> a() {}
|
||||
|
||||
fun test() {
|
||||
Foo::class
|
||||
Foo.Bar::class
|
||||
Foo.Bar.Baz::class
|
||||
|
||||
a<Foo.Bar<String>>()
|
||||
a<Foo.Bar.Baz>()
|
||||
|
||||
<!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo<String>.Bar<!>::class
|
||||
<!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo<<!DEBUG_INFO_MISSING_UNRESOLVED!>String<!>>.Bar.Baz<!>::class
|
||||
|
||||
a<<!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED, WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<String>.Bar<!>>()
|
||||
a<<!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo<<!DEBUG_INFO_MISSING_UNRESOLVED!>String<!>>.Bar.Baz<!>>()
|
||||
|
||||
a<Foo.Bar<Int>>()
|
||||
a<<!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo.Bar<Int>.Baz<!>>()
|
||||
}
|
||||
|
||||
fun <T: Foo<String.<!UNRESOLVED_REFERENCE!>Bar<!>>> x() {}
|
||||
fun <!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED, WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Foo<String>.Bar<!>.ext() {}
|
||||
|
||||
fun ex1(<!UNUSED_PARAMETER!>a<!>: <!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo<String>.Bar<String><!>): <!GENERICS_IN_CONTAINING_TYPE_NOT_ALLOWED!>Foo<String>.Bar<String><!> {
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
@@ -0,0 +1,28 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> a(): kotlin.Unit
|
||||
public fun ex1(/*0*/ a: Foo.Bar<kotlin.String>): Foo.Bar<kotlin.String>
|
||||
public fun test(): kotlin.Unit
|
||||
public fun </*0*/ T : Foo<[ERROR : String.Bar]>> x(): kotlin.Unit
|
||||
public fun [ERROR : Bar].ext(): kotlin.Unit
|
||||
|
||||
public final class Foo</*0*/ T> {
|
||||
public constructor Foo</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Bar</*0*/ X> {
|
||||
public constructor Bar</*0*/ X>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final class Baz {
|
||||
public constructor Baz()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user