alvr
01/28/2025, 3:45 PMcopy method (as in data classes), but open for normal classes. I want to annotate a class and the IDE to know that a new method copy is available to use. I'm using IrElementTransformerVoidWithContext and FirDeclarationGenerationExtension to do the transformation, but when adding SyntheticResolveExtension to generate the synthetic method, the compiler throws the following error:
FUN name:copy visibility:public modality:OPEN <> (a:<http://kotlin.Int|kotlin.Int>, value:kotlin.String) returnType:com.example.MyClass
VALUE_PARAMETER name:id index:0 type:<http://kotlin.Int|kotlin.Int>
EXPRESSION_BODY
ERROR_EXPR 'Default Stub' type=<http://kotlin.Int|kotlin.Int>
VALUE_PARAMETER name:value index:1 type:kotlin.String
EXPRESSION_BODY
ERROR_EXPR 'Default Stub' type=kotlin.String
...
Function has no body: FUN name:copy visibility:public modality:OPEN <> (id:<http://kotlin.Int|kotlin.Int>, value:kotlin.String) returnType:com.example.MyClass
Here is the code for the three classes: https://gist.github.com/alvr/6b03b122464226db79dd20d6cd1380bbYoussef Shoaib [MOD]
01/28/2025, 4:57 PMYoussef Shoaib [MOD]
01/28/2025, 5:03 PMalvr
01/31/2025, 11:26 AMYoussef Shoaib [MOD]
01/31/2025, 12:03 PMalvr
01/31/2025, 12:08 PMkotlin.k2.only.bundled.compiler.plugins.enabled in the registry, but still no autocompletion. The method is in red but compiling is workingYoussef Shoaib [MOD]
01/31/2025, 12:08 PM