@@ -36,7 +36,8 @@ import Names.TermName
3636import Annotations .Annotation
3737import Names .Name
3838
39- class DottyBackendInterface (val outputDirectory : AbstractFile , val superCallsMap : Map [Symbol , Set [ClassSymbol ]])(using val ctx : Context ) {
39+ class DottyBackendInterface (val outputDirectory : AbstractFile , val superCallsMap : Map [Symbol , Set [ClassSymbol ]])
40+ (using val ctx : Context , val cs : CState ) {
4041
4142 private val desugared = new java.util.IdentityHashMap [Type , tpd.Select ]
4243
@@ -109,16 +110,16 @@ object DottyBackendInterface {
109110 else clazz.getName
110111 }
111112
112- def requiredClass (str : String )(using Context ): ClassSymbol =
113+ def requiredClass (str : String )(using Context , CState ): ClassSymbol =
113114 Symbols .requiredClass(str)
114115
115- def requiredClass [T ](using evidence : ClassTag [T ], ctx : Context ): Symbol =
116+ def requiredClass [T ](using evidence : ClassTag [T ], ctx : Context , cs : CState ): Symbol =
116117 requiredClass(erasureString(evidence.runtimeClass))
117118
118- def requiredModule (str : String )(using Context ): Symbol =
119+ def requiredModule (str : String )(using Context , CState ): Symbol =
119120 Symbols .requiredModule(str)
120121
121- def requiredModule [T ](using evidence : ClassTag [T ], ctx : Context ): Symbol = {
122+ def requiredModule [T ](using evidence : ClassTag [T ], ctx : Context , cs : CState ): Symbol = {
122123 val moduleName = erasureString(evidence.runtimeClass)
123124 val className = if (moduleName.endsWith(" $" )) moduleName.dropRight(1 ) else moduleName
124125 requiredModule(className)
@@ -127,19 +128,19 @@ object DottyBackendInterface {
127128 given symExtensions as AnyRef :
128129 extension (sym : Symbol ):
129130
130- def isInterface (using Context ): Boolean = (sym.is(PureInterface )) || sym.is(Trait )
131+ def isInterface (using Context , CState ): Boolean = (sym.is(PureInterface )) || sym.is(Trait )
131132
132- def isStaticConstructor (using Context ): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR )
133+ def isStaticConstructor (using Context , CState ): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR )
133134
134- def isStaticMember (using Context ): Boolean = (sym ne NoSymbol ) &&
135+ def isStaticMember (using Context , CState ): Boolean = (sym ne NoSymbol ) &&
135136 (sym.is(JavaStatic ) || sym.isScalaStatic)
136137 // guard against no sumbol cause this code is executed to select which call type(static\dynamic) to use to call array.clone
137138
138139 /**
139140 * True for module classes of modules that are top-level or owned only by objects. Module classes
140141 * for such objects will get a MODULE$ flag and a corresponding static initializer.
141142 */
142- def isStaticModuleClass (using Context ): Boolean =
143+ def isStaticModuleClass (using Context , CState ): Boolean =
143144 (sym.is(Module )) && {
144145 // scalac uses atPickling here
145146 // this would not work if modules are created after pickling
@@ -153,7 +154,7 @@ object DottyBackendInterface {
153154
154155
155156
156- def originalLexicallyEnclosingClass (using Context ): Symbol =
157+ def originalLexicallyEnclosingClass (using Context , CState ): Symbol =
157158 // used to populate the EnclosingMethod attribute.
158159 // it is very tricky in presence of classes(and annonymous classes) defined inside supper calls.
159160 if (sym.exists) {
@@ -167,15 +168,15 @@ object DottyBackendInterface {
167168 * True for module classes of package level objects. The backend will generate a mirror class for
168169 * such objects.
169170 */
170- def isTopLevelModuleClass (using Context ): Boolean =
171+ def isTopLevelModuleClass (using Context , CState ): Boolean =
171172 sym.is(ModuleClass ) &&
172173 atPhase(flattenPhase) {
173174 toDenot(sym).owner.is(PackageClass )
174175 }
175176
176- def javaSimpleName (using Context ): String = toDenot(sym).name.mangledString
177- def javaClassName (using Context ): String = toDenot(sym).fullName.mangledString
178- def javaBinaryName (using Context ): String = javaClassName.replace('.' , '/' )
177+ def javaSimpleName (using Context , CState ): String = toDenot(sym).name.mangledString
178+ def javaClassName (using Context , CState ): String = toDenot(sym).fullName.mangledString
179+ def javaBinaryName (using Context , CState ): String = javaClassName.replace('.' , '/' )
179180
180181 end extension
181182
@@ -197,7 +198,7 @@ object DottyBackendInterface {
197198 * True if the current compilation unit is of a primitive class (scala.Boolean et al).
198199 * Used only in assertions.
199200 */
200- def isCompilingPrimitive (using Context ) = {
201+ def isCompilingPrimitive (using Context , CState ) = {
201202 primitiveCompilationUnits(ctx.compilationUnit.source.file.name)
202203 }
203204
0 commit comments