Do not deserialize type aliases in compatibility mode

When "-language-version 1.0" is specified in command line arguments, the
compiler should not be able to see the declarations of type aliases in
libraries, because that corresponds to the behavior of the compiler of version
1.0. Note that type aliases are _completely invisible_ in this mode (i.e.
"unresolved reference" is reported) because they must not interfere with the
classifier resolution
This commit is contained in:
Alexander Udalov
2016-10-11 14:14:59 +03:00
parent d96f10c7bd
commit e37a20d6b3
7 changed files with 58 additions and 10 deletions
@@ -0,0 +1,8 @@
import test.*
import test.Str
fun use(
str: Str,
l: L<Str>,
nested: Klass.Nested
) {}
@@ -0,0 +1,16 @@
compiler/testData/compileKotlinAgainstCustomBinaries/typeAliasesAreInvisibleInCompatibilityMode/main.kt:2:13: error: unresolved reference: Str
import test.Str
^
compiler/testData/compileKotlinAgainstCustomBinaries/typeAliasesAreInvisibleInCompatibilityMode/main.kt:5:14: error: unresolved reference: Str
str: Str,
^
compiler/testData/compileKotlinAgainstCustomBinaries/typeAliasesAreInvisibleInCompatibilityMode/main.kt:6:12: error: unresolved reference: L
l: L<Str>,
^
compiler/testData/compileKotlinAgainstCustomBinaries/typeAliasesAreInvisibleInCompatibilityMode/main.kt:6:14: error: unresolved reference: Str
l: L<Str>,
^
compiler/testData/compileKotlinAgainstCustomBinaries/typeAliasesAreInvisibleInCompatibilityMode/main.kt:7:23: error: unresolved reference: Nested
nested: Klass.Nested
^
COMPILATION_ERROR
@@ -0,0 +1,10 @@
package test
typealias Str = String
typealias L<T> = List<T>
class Klass {
typealias Nested = Z
class Z
}