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
@@ -17,5 +17,8 @@
package org.jetbrains.kotlin.serialization.deserialization
interface DeserializationConfiguration {
val typeAliasesAllowed: Boolean
get() = true
object Default : DeserializationConfiguration
}
@@ -51,7 +51,9 @@ abstract class DeserializedMemberScope protected constructor(
}
private val typeAliasProtos by
c.storageManager.createLazyValue {
typeAliasList.groupByName { it.name }
if (c.components.configuration.typeAliasesAllowed)
typeAliasList.groupByName { it.name }
else emptyMap()
}
private val functions =