You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/suspend-transform-plugin/src/main/kotlin/love/forte/plugin/suspendtrans/ir/SuspendTransformTransformer.kt
@@ -40,7 +40,7 @@ fun IrSimpleFunction.asProperty(): IrProperty {
40
40
parent = parentClassOrFile
41
41
getter = baseFunction
42
42
}
43
-
43
+
44
44
return property
45
45
}
46
46
@@ -59,17 +59,125 @@ fun IrPluginContext.createSuspendLambdaWithCoroutineScope(
59
59
returnIrFactoryImpl.buildClass {
60
60
name =SpecialNames.NO_NAME_PROVIDED
61
61
kind =ClassKind.CLASS
62
-
// isInner = true
62
+
/*
63
+
Those three lines are required, especially `visibility` and `isInner`
64
+
All the local classes should have it
65
+
66
+
see https://youtrack.jetbrains.com/issue/KT-53993/IR-kotlin.NotImplementedError-An-operation-is-not-implemented-IrClassImpl-is-not-supported-yet-here#focus=Comments-27-8622204.0-0
67
+
*/
68
+
69
+
isFun =true
70
+
//isInner = true
71
+
visibility =DescriptorVisibilities.LOCAL
72
+
}.apply clazz@{
73
+
this.parent = parent
74
+
superTypes =listOf(lambdaType)
75
+
76
+
val fields = originFunction.paramsAndReceiversAsParamsList().map {
* - takes dispatch and extension receivers as param, followed by normal value params, to the constructor of this object
149
+
*/
150
+
fun IrPluginContext.createSuspendLambdaFunctionWithCoroutineScope(
151
+
parent:IrDeclarationParent,
152
+
lambdaType:IrSimpleType,
153
+
originFunction:IrFunction,
154
+
): IrClass {
155
+
156
+
157
+
returnIrFactoryImpl.buildClass {
158
+
name =SpecialNames.NO_NAME_PROVIDED
159
+
kind =ClassKind.CLASS
160
+
161
+
/*
162
+
Those three lines are required, especially `visibility` and `isInner`
163
+
All the local classes should have it
164
+
165
+
see https://youtrack.jetbrains.com/issue/KT-53993/IR-kotlin.NotImplementedError-An-operation-is-not-implemented-IrClassImpl-is-not-supported-yet-here#focus=Comments-27-8622204.0-0
166
+
*/
167
+
168
+
isFun =true
169
+
//isInner = true
170
+
visibility =DescriptorVisibilities.LOCAL
63
171
}.apply clazz@{
64
172
this.parent = parent
65
173
superTypes =listOf(lambdaType)
66
-
174
+
67
175
val fields = originFunction.paramsAndReceiversAsParamsList().map {
// // 'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: https://youtrack.jetbrains.com/issue/KT-61573
0 commit comments