FIR checker: report unresolved reference in imports
Compared to FE1.0, instead of using UNRESOLVED_REFERENCE, a new UNRESOLVED_IMPORT diagnostic is introduced. This is so that we can use a different positioning strategy to highlight the last part of the import if the entire import is passed. Also, this change fixed some incorrectly rejected imports in FIR. Such cases are covered the newly added test file staticFunAndPropertyImport.kt
This commit is contained in:
committed by
teamcityserver
parent
f51b108821
commit
18f7a760bb
@@ -7,15 +7,15 @@ import b.ext //extension function
|
||||
import b.value //property
|
||||
import b.C.Companion.bar //function from companion object
|
||||
import b.C.Companion.cValue //property from companion object
|
||||
import b.constant.fff //function from val
|
||||
import b.constant.dValue //property from val
|
||||
import b.<!UNRESOLVED_IMPORT!>constant<!>.fff //function from val
|
||||
import b.<!UNRESOLVED_IMPORT!>constant<!>.dValue //property from val
|
||||
import b.constant
|
||||
import b.E.Companion.f //val from companion object
|
||||
import smth.illegal
|
||||
import b.C.smth.illegal
|
||||
import b.bar.smth
|
||||
import b.bar.*
|
||||
import b.unr.unr.unr
|
||||
import b.C.<!UNRESOLVED_IMPORT!>smth<!>.illegal
|
||||
import b.<!UNRESOLVED_IMPORT!>bar<!>.smth
|
||||
import b.<!UNRESOLVED_IMPORT!>bar<!>.*
|
||||
import b.<!UNRESOLVED_IMPORT!>unr<!>.unr.unr
|
||||
import unr.unr.unr
|
||||
|
||||
fun test(arg: B) {
|
||||
|
||||
+12
-12
@@ -52,27 +52,27 @@ import <!PACKAGE_CANNOT_BE_IMPORTED!>a<!>
|
||||
import a.<!PACKAGE_CANNOT_BE_IMPORTED!>b<!>
|
||||
|
||||
import a.foo
|
||||
import a.foo.bar
|
||||
import a.<!UNRESOLVED_IMPORT!>foo<!>.bar
|
||||
import a.bar
|
||||
import a.bar.foo
|
||||
import a.<!UNRESOLVED_IMPORT!>bar<!>.foo
|
||||
|
||||
import a.B.<!CANNOT_BE_IMPORTED!>foo<!>
|
||||
import a.B.foo.bar
|
||||
import a.B.<!UNRESOLVED_IMPORT!>foo<!>.bar
|
||||
import a.B.<!CANNOT_BE_IMPORTED!>bar<!>
|
||||
import a.B.bar.foo
|
||||
import a.B.<!UNRESOLVED_IMPORT!>bar<!>.foo
|
||||
|
||||
import a.C.foo
|
||||
import a.C.foo.bar
|
||||
import a.C.<!UNRESOLVED_IMPORT!>foo<!>.bar
|
||||
import a.C.bar
|
||||
import a.C.bar.foo
|
||||
import a.C.<!UNRESOLVED_IMPORT!>bar<!>.foo
|
||||
import a.C.Nested
|
||||
|
||||
import a.D.foo
|
||||
import a.D.foo.bar
|
||||
import a.D.bar
|
||||
import a.D.bar.foo
|
||||
import a.D.<!UNRESOLVED_IMPORT!>foo<!>
|
||||
import a.D.<!UNRESOLVED_IMPORT!>foo<!>.bar
|
||||
import a.D.<!UNRESOLVED_IMPORT!>bar<!>
|
||||
import a.D.<!UNRESOLVED_IMPORT!>bar<!>.foo
|
||||
|
||||
import a.D.Companion.foo
|
||||
import a.D.Companion.foo.bar
|
||||
import a.D.Companion.<!UNRESOLVED_IMPORT!>foo<!>.bar
|
||||
import a.D.Companion.bar
|
||||
import a.D.Companion.bar.foo
|
||||
import a.D.Companion.<!UNRESOLVED_IMPORT!>bar<!>.foo
|
||||
|
||||
@@ -18,7 +18,7 @@ interface IInterfaceOutput<out T> {
|
||||
|
||||
package mypackage.nestedpackage
|
||||
|
||||
import mypackage.nestedpackage.Bar.Baz
|
||||
import mypackage.nestedpackage.Bar.<!UNRESOLVED_IMPORT!>Baz<!>
|
||||
import anotherpackage.IInterfaceInput
|
||||
import anotherpackage.IInterfaceOutput
|
||||
|
||||
@@ -43,4 +43,4 @@ class Bar() : IInterfaceInput<Baz>, IInterfaceOutput<Baz> {
|
||||
|
||||
}
|
||||
|
||||
data class Baz(val myField: Int)
|
||||
data class Baz(val myField: Int)
|
||||
|
||||
@@ -8,15 +8,15 @@ import b.ext //extension function
|
||||
import b.value //property
|
||||
import b.C.Companion.bar //function from companion object
|
||||
import b.C.Companion.cValue //property from companion object
|
||||
import b.constant.fff //function from val
|
||||
import b.constant.dValue //property from val
|
||||
import b.<!UNRESOLVED_IMPORT!>constant<!>.fff //function from val
|
||||
import b.<!UNRESOLVED_IMPORT!>constant<!>.dValue //property from val
|
||||
import smth.illegal
|
||||
import b.C.smth.illegal
|
||||
import b.C.<!UNRESOLVED_IMPORT!>smth<!>.illegal
|
||||
|
||||
<!SYNTAX!><<!><!SYNTAX!><<!><!SYNTAX!><<!><!SYNTAX!>HEAD<!><!SYNTAX!><!>
|
||||
import b.bar.smth
|
||||
import b.bar.*
|
||||
import b.unr.unr.unr
|
||||
import b.<!UNRESOLVED_IMPORT!>bar<!>.smth
|
||||
import b.<!UNRESOLVED_IMPORT!>bar<!>.*
|
||||
import b.<!UNRESOLVED_IMPORT!>unr<!>.unr.unr
|
||||
import unr.unr.unr
|
||||
import b.constant
|
||||
import b.E.Companion.f //val from companion object
|
||||
|
||||
Reference in New Issue
Block a user