Value classes: Add isValue property to class descriptors

Reuse isInline flag in proto and IR.
Check metadata version on deserialization.
This commit is contained in:
Ilmir Usmanov
2020-11-17 03:25:04 +01:00
parent 8eff3a6bb3
commit 361ed117bb
16 changed files with 63 additions and 1 deletions
@@ -98,7 +98,7 @@ class DeserializedClassDescriptor(
override fun isData() = Flags.IS_DATA.get(classProto.flags)
override fun isInline() = Flags.IS_INLINE_CLASS.get(classProto.flags)
override fun isInline() = Flags.IS_INLINE_CLASS.get(classProto.flags) && metadataVersion.isAtMost(1, 4, 1)
override fun isExpect() = Flags.IS_EXPECT_CLASS.get(classProto.flags)
@@ -108,6 +108,8 @@ class DeserializedClassDescriptor(
override fun isFun() = Flags.IS_FUN_INTERFACE.get(classProto.flags)
override fun isValue() = Flags.IS_INLINE_CLASS.get(classProto.flags) && metadataVersion.isAtLeast(1, 4, 2)
override fun getUnsubstitutedMemberScope(kotlinTypeRefiner: KotlinTypeRefiner): MemberScope =
memberScopeHolder.getScope(kotlinTypeRefiner)