@@ -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,36 +110,36 @@ 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)
125126 }
126127
127128 extension symExtensions on (sym : Symbol ) {
128129
129- def isInterface (using Context ): Boolean = (sym.is(PureInterface )) || sym.is(Trait )
130+ def isInterface (using Context , CState ): Boolean = (sym.is(PureInterface )) || sym.is(Trait )
130131
131- def isStaticConstructor (using Context ): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR )
132+ def isStaticConstructor (using Context , CState ): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR )
132133
133- def isStaticMember (using Context ): Boolean = (sym ne NoSymbol ) &&
134+ def isStaticMember (using Context , CState ): Boolean = (sym ne NoSymbol ) &&
134135 (sym.is(JavaStatic ) || sym.isScalaStatic)
135136 // guard against no sumbol cause this code is executed to select which call type(static\dynamic) to use to call array.clone
136137
137138 /**
138139 * True for module classes of modules that are top-level or owned only by objects. Module classes
139140 * for such objects will get a MODULE$ flag and a corresponding static initializer.
140141 */
141- def isStaticModuleClass (using Context ): Boolean =
142+ def isStaticModuleClass (using Context , CState ): Boolean =
142143 (sym.is(Module )) && {
143144 // scalac uses atPickling here
144145 // this would not work if modules are created after pickling
@@ -152,7 +153,7 @@ object DottyBackendInterface {
152153
153154
154155
155- def originalLexicallyEnclosingClass (using Context ): Symbol =
156+ def originalLexicallyEnclosingClass (using Context , CState ): Symbol =
156157 // used to populate the EnclosingMethod attribute.
157158 // it is very tricky in presence of classes(and annonymous classes) defined inside supper calls.
158159 if (sym.exists) {
@@ -166,15 +167,15 @@ object DottyBackendInterface {
166167 * True for module classes of package level objects. The backend will generate a mirror class for
167168 * such objects.
168169 */
169- def isTopLevelModuleClass (using Context ): Boolean =
170+ def isTopLevelModuleClass (using Context , CState ): Boolean =
170171 sym.is(ModuleClass ) &&
171172 atPhase(flattenPhase) {
172173 toDenot(sym).owner.is(PackageClass )
173174 }
174175
175- def javaSimpleName (using Context ): String = toDenot(sym).name.mangledString
176- def javaClassName (using Context ): String = toDenot(sym).fullName.mangledString
177- def javaBinaryName (using Context ): String = javaClassName.replace('.' , '/' )
176+ def javaSimpleName (using Context , CState ): String = toDenot(sym).name.mangledString
177+ def javaClassName (using Context , CState ): String = toDenot(sym).fullName.mangledString
178+ def javaBinaryName (using Context , CState ): String = javaClassName.replace('.' , '/' )
178179 }
179180
180181 private val primitiveCompilationUnits = Set (
@@ -193,7 +194,7 @@ object DottyBackendInterface {
193194 * True if the current compilation unit is of a primitive class (scala.Boolean et al).
194195 * Used only in assertions.
195196 */
196- def isCompilingPrimitive (using Context ) = {
197+ def isCompilingPrimitive (using Context , CState ) = {
197198 primitiveCompilationUnits(ctx.compilationUnit.source.file.name)
198199 }
199200
0 commit comments