Refactor resolution of double colon expression LHS
Try resolving the LHS only when it looks (PSI-wise) like it could represent a type element. This, for example, allows "illegal selector" error to be reported on weird expressions like '""?.""::class'. Also remove expression text from the "illegal selector" diagnostic, it's not needed and can screw up the error message if the text is too big
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
package foo
|
||||
|
||||
fun test() {
|
||||
<!UNRESOLVED_REFERENCE!>foo<!>::test
|
||||
<!EXPRESSION_EXPECTED_PACKAGE_FOUND!>foo<!>::test
|
||||
}
|
||||
|
||||
// FILE: qualifiedName.kt
|
||||
@@ -12,5 +12,5 @@ fun test() {
|
||||
package foo.bar
|
||||
|
||||
fun test() {
|
||||
foo.<!UNRESOLVED_REFERENCE!>bar<!>::test
|
||||
foo.<!EXPRESSION_EXPECTED_PACKAGE_FOUND!>bar<!>::test
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user