Rework const val generation in multifile classes
Do not query MultifileClassCodegen#classBuilder early on: this causes the class file for the facade to be prematurely dumped to the disk in some cases, when that class file is not yet completely generated. Instead fork the logic in PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts, generate method in the facade
This commit is contained in:
@@ -5,6 +5,10 @@ fun p1Fun() {}
|
||||
fun String.p1ExtFun() {}
|
||||
fun p1ExprFun(): Int = 0
|
||||
fun p1FunWithParams(x: Int): Int { return x }
|
||||
|
||||
val p1Val: Int = 0
|
||||
val String.p1ExtVal: Int get() = 0
|
||||
var p1Var: Int = 0
|
||||
var p1Var: Int = 0
|
||||
|
||||
@Deprecated("deprecated")
|
||||
const val annotatedConstVal = 42
|
||||
|
||||
@@ -2,6 +2,20 @@ PsiJetFileStubImpl[package=test]
|
||||
PACKAGE_DIRECTIVE:
|
||||
REFERENCE_EXPRESSION:[referencedName=test]
|
||||
IMPORT_LIST:
|
||||
PROPERTY:[fqName=test.annotatedConstVal, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=true, isVar=false, name=annotatedConstVal]
|
||||
MODIFIER_LIST:[public const]
|
||||
ANNOTATION_ENTRY:[hasValueArguments=false, shortName=Deprecated]
|
||||
CONSTRUCTOR_CALLEE:
|
||||
TYPE_REFERENCE:
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION:[referencedName=Deprecated]
|
||||
TYPE_REFERENCE:
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
USER_TYPE:[isAbsoluteInRootPackage=false]
|
||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION:[referencedName=Int]
|
||||
PROPERTY:[fqName=test.p1Val, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=true, isVar=false, name=p1Val]
|
||||
MODIFIER_LIST:[public]
|
||||
TYPE_REFERENCE:
|
||||
|
||||
Reference in New Issue
Block a user