CLI: fix resolution of Java records as single file roots
#KT-46764 Fixed
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
// This import checks that the compiler won't parse the "record" word as a soft keyword
|
||||
// and load the non-existing class named "Unresolved" from this Java source.
|
||||
import record.Unresolved;
|
||||
|
||||
// This class should be resolved correctly.
|
||||
public record Record(String string) {}
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/Record.java
|
||||
$TESTDATA_DIR$/recordAsSingleFileRoot.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,5 @@
|
||||
// This should compile.
|
||||
fun create(): Record = Record("OK")
|
||||
|
||||
// This should be an error.
|
||||
fun error(): Unresolved? = null
|
||||
@@ -0,0 +1,4 @@
|
||||
compiler/testData/cli/jvm/recordAsSingleFileRoot.kt:5:14: error: unresolved reference: Unresolved
|
||||
fun error(): Unresolved? = null
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
Reference in New Issue
Block a user