[FIR] Start enum entries reworking
This commit is contained in:
committed by
Mikhail Glukhikh
parent
68d64f1b5c
commit
13132e69a3
@@ -49,7 +49,7 @@ fun <T> bar(a: Any): T = a as T
|
||||
fun <T> foo() {
|
||||
foo<Color.RED>()
|
||||
foo<RedAlias>()
|
||||
bar<Color.RED>(Color.RED)
|
||||
<!INAPPLICABLE_CANDIDATE!>bar<!><Color.RED>(Color.RED)
|
||||
}
|
||||
|
||||
fun Array<Color.RED>.foo(entries: Array<Color.RED>): Array<Color.RED> = null!!
|
||||
+4
-4
@@ -16,12 +16,12 @@ enum class C {
|
||||
|
||||
E4 {
|
||||
fun c() {
|
||||
this.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
this.B()
|
||||
|
||||
C.A()
|
||||
A()
|
||||
//TODO: should be resolved with error
|
||||
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
this.A()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,6 +45,6 @@ fun f() {
|
||||
C.A()
|
||||
C.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
C.E3.O_O
|
||||
C.E3.G()
|
||||
C.E3.<!UNRESOLVED_REFERENCE!>O_O<!>
|
||||
C.E3.<!UNRESOLVED_REFERENCE!>G<!>()
|
||||
}
|
||||
|
||||
+4
-4
@@ -16,12 +16,12 @@ enum class C {
|
||||
|
||||
E4 {
|
||||
fun c() {
|
||||
this.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
this.B()
|
||||
|
||||
C.A()
|
||||
A()
|
||||
//TODO: should be resolved with error
|
||||
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
this.A()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -45,6 +45,6 @@ fun f() {
|
||||
C.A()
|
||||
C.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
C.E3.O_O
|
||||
C.E3.G()
|
||||
C.E3.<!UNRESOLVED_REFERENCE!>O_O<!>
|
||||
C.E3.<!UNRESOLVED_REFERENCE!>G<!>()
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ package kt1193
|
||||
|
||||
enum class MyEnum(val i: Int) {
|
||||
A(12),
|
||||
B //no error
|
||||
<!INAPPLICABLE_CANDIDATE!>B<!> //no error
|
||||
}
|
||||
|
||||
open class A(x: Int = 1)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ enum class TestOk(val x: String = "OK") {
|
||||
}
|
||||
|
||||
enum class TestErrors(val x: String) {
|
||||
TEST1,
|
||||
<!INAPPLICABLE_CANDIDATE!>TEST1,<!>
|
||||
TEST2<!INAPPLICABLE_CANDIDATE!><!>(),
|
||||
TEST3("Hello")
|
||||
}
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@ fun f1() = E.FIRST.foo()
|
||||
fun f2() = E.FIRST.(foo)()
|
||||
fun f3() = E.SECOND.foo()
|
||||
fun f4() = E.SECOND.(foo)()
|
||||
fun f5() = E.SECOND.A()
|
||||
fun f5() = E.SECOND.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@ fun f1() = E.FIRST.foo()
|
||||
fun f2() = E.FIRST.(foo)()
|
||||
fun f3() = E.SECOND.foo()
|
||||
fun f4() = E.SECOND.(foo)()
|
||||
fun f5() = E.SECOND.A()
|
||||
fun f5() = E.SECOND.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
enum interface Some {
|
||||
// Enum part
|
||||
D;
|
||||
<!UNRESOLVED_REFERENCE!>D;<!>
|
||||
|
||||
// Interface like part
|
||||
fun test()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
enum class E {
|
||||
E1 {
|
||||
override fun foo() = outerFun() <!AMBIGUITY!>+<!> super.<!UNRESOLVED_REFERENCE!>outerFun<!>()
|
||||
override fun foo() = outerFun() + super.outerFun()
|
||||
},
|
||||
E2 {
|
||||
override fun foo() = E1.foo()
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// FILE: common.kt
|
||||
|
||||
expect enum class En(x: Int) {
|
||||
E1,
|
||||
<!INAPPLICABLE_CANDIDATE!>E1,<!>
|
||||
E2(42),
|
||||
;
|
||||
|
||||
|
||||
+1
-1
@@ -17,5 +17,5 @@ enum class En {
|
||||
|
||||
fun ENTRY() = 42
|
||||
|
||||
fun SUBCLASS() = <!AMBIGUITY!>ENTRY<!>()
|
||||
fun SUBCLASS() = ENTRY()
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ object A {
|
||||
|
||||
enum class B {
|
||||
X() {
|
||||
constructor()
|
||||
<!CONSTRUCTOR_IN_OBJECT!>constructor()<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ enum class MyEnum { A }
|
||||
typealias TestAlias = MyEnum
|
||||
|
||||
val test1 = MyEnum.A
|
||||
val test2 = TestAlias.<!UNRESOLVED_REFERENCE!>A<!>
|
||||
val test2 = TestAlias.A
|
||||
@@ -25,6 +25,6 @@ import test.EnumAlias
|
||||
|
||||
|
||||
fun bar() {
|
||||
<!UNRESOLVED_REFERENCE!>Entry<!>
|
||||
EnumAlias.<!UNRESOLVED_REFERENCE!>Entry<!>
|
||||
Entry
|
||||
EnumAlias.Entry
|
||||
}
|
||||
Reference in New Issue
Block a user