Basic inline class mapping to the underlying representation

This commit is contained in:
Mikhail Zarechenskiy
2018-01-24 14:33:30 +03:00
parent 4b4525ec17
commit d5400f11a3
7 changed files with 106 additions and 27 deletions
@@ -0,0 +1,14 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.resolve
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
fun ClassDescriptor.underlyingRepresentation(): ValueParameterDescriptor? {
if (!isInline) return null
return unsubstitutedPrimaryConstructor?.valueParameters?.singleOrNull()
}