@@ -27,6 +27,7 @@ import dotty.tools.dotc.core.Types._
27
27
import dotty .tools .dotc .core .TypeErasure
28
28
import dotty .tools .dotc .transform .GenericSignatures
29
29
import dotty .tools .io .AbstractFile
30
+ import dotty .tools .dotc .report
30
31
31
32
import dotty .tools .backend .jvm .DottyBackendInterface .symExtensions
32
33
@@ -52,11 +53,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
52
53
def ScalaATTRName : String = " Scala"
53
54
def ScalaSignatureATTRName : String = " ScalaSig"
54
55
55
- @ threadUnsafe lazy val AnnotationRetentionAttr : ClassSymbol = ctx. requiredClass(" java.lang.annotation.Retention" )
56
- @ threadUnsafe lazy val AnnotationRetentionSourceAttr : TermSymbol = ctx. requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" SOURCE" )
57
- @ threadUnsafe lazy val AnnotationRetentionClassAttr : TermSymbol = ctx. requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" CLASS" )
58
- @ threadUnsafe lazy val AnnotationRetentionRuntimeAttr : TermSymbol = ctx. requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" RUNTIME" )
59
- @ threadUnsafe lazy val JavaAnnotationClass : ClassSymbol = ctx. requiredClass(" java.lang.annotation.Annotation" )
56
+ @ threadUnsafe lazy val AnnotationRetentionAttr : ClassSymbol = requiredClass(" java.lang.annotation.Retention" )
57
+ @ threadUnsafe lazy val AnnotationRetentionSourceAttr : TermSymbol = requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" SOURCE" )
58
+ @ threadUnsafe lazy val AnnotationRetentionClassAttr : TermSymbol = requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" CLASS" )
59
+ @ threadUnsafe lazy val AnnotationRetentionRuntimeAttr : TermSymbol = requiredClass(" java.lang.annotation.RetentionPolicy" ).linkedClass.requiredValue(" RUNTIME" )
60
+ @ threadUnsafe lazy val JavaAnnotationClass : ClassSymbol = requiredClass(" java.lang.annotation.Annotation" )
60
61
61
62
val bCodeAsmCommon : BCodeAsmCommon [int.type ] = new BCodeAsmCommon (int)
62
63
import bCodeAsmCommon ._
@@ -76,7 +77,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
76
77
outputDirectory
77
78
} catch {
78
79
case ex : Throwable =>
79
- ctx .error(s " Couldn't create file for class $cName\n ${ex.getMessage}" , ctx.source.atSpan(csym.span))
80
+ report .error(s " Couldn't create file for class $cName\n ${ex.getMessage}" , ctx.source.atSpan(csym.span))
80
81
null
81
82
}
82
83
}
@@ -425,7 +426,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
425
426
emitAssocs(nestedVisitor, assocs, bcodeStore)(innerClasesStore)
426
427
427
428
case t =>
428
- ctx .error(ex " Annotation argument is not a constant " , t.sourcePos)
429
+ report .error(ex " Annotation argument is not a constant " , t.sourcePos)
429
430
}
430
431
}
431
432
@@ -563,26 +564,26 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
563
564
*/
564
565
def addForwarders (jclass : asm.ClassVisitor , jclassName : String , moduleClass : Symbol ): Unit = {
565
566
assert(moduleClass.is(ModuleClass ), moduleClass)
566
- ctx .debuglog(s " Dumping mirror class for object: $moduleClass" )
567
+ report .debuglog(s " Dumping mirror class for object: $moduleClass" )
567
568
568
569
val linkedClass = moduleClass.companionClass
569
570
lazy val conflictingNames : Set [Name ] = {
570
571
(linkedClass.info.allMembers.collect { case d if d.name.isTermName => d.name }).toSet
571
572
}
572
- ctx .debuglog(s " Potentially conflicting names for forwarders: $conflictingNames" )
573
+ report .debuglog(s " Potentially conflicting names for forwarders: $conflictingNames" )
573
574
574
575
for (m0 <- sortedMembersBasedOnFlags(moduleClass.info, required = Method , excluded = ExcludedForwarder )) {
575
576
val m = if (m0.is(Bridge )) m0.nextOverriddenSymbol else m0
576
577
if (m == NoSymbol )
577
- ctx .log(s " $m0 is a bridge method that overrides nothing, something went wrong in a previous phase. " )
578
+ report .log(s " $m0 is a bridge method that overrides nothing, something went wrong in a previous phase. " )
578
579
else if (m.isType || m.is(Deferred ) || (m.owner eq defn.ObjectClass ) || m.isConstructor || m.name.is(ExpandedName ))
579
- ctx .debuglog(s " No forwarder for ' $m' from $jclassName to ' $moduleClass' " )
580
+ report .debuglog(s " No forwarder for ' $m' from $jclassName to ' $moduleClass' " )
580
581
else if (conflictingNames(m.name))
581
- ctx .log(s " No forwarder for $m due to conflict with ${linkedClass.info.member(m.name)}" )
582
+ report .log(s " No forwarder for $m due to conflict with ${linkedClass.info.member(m.name)}" )
582
583
else if (m.accessBoundary(defn.RootClass ) ne defn.RootClass )
583
- ctx .log(s " No forwarder for non-public member $m" )
584
+ report .log(s " No forwarder for non-public member $m" )
584
585
else {
585
- ctx .log(s " Adding static forwarder for ' $m' from $jclassName to ' $moduleClass' " )
586
+ report .log(s " Adding static forwarder for ' $m' from $jclassName to ' $moduleClass' " )
586
587
addForwarder(jclass, moduleClass, m)
587
588
}
588
589
}
@@ -822,7 +823,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
822
823
* The type in the AnnotationInfo is an AnnotatedTpe. Tested in jvm/annotations.scala.
823
824
*/
824
825
case a @ AnnotatedType (t, _) =>
825
- ctx .debuglog(s " typeKind of annotated type $a" )
826
+ report .debuglog(s " typeKind of annotated type $a" )
826
827
typeToTypeKind(t)(ct)(storage)
827
828
828
829
/* The cases below should probably never occur. They are kept for now to avoid introducing
@@ -831,7 +832,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
831
832
*/
832
833
833
834
case tp =>
834
- ctx .warning(
835
+ report .warning(
835
836
s " an unexpected type representation reached the compiler backend while compiling ${ctx.compilationUnit}: $tp. " +
836
837
" If possible, please file a bug on https://github.com/lampepfl/dotty/issues" )
837
838
@@ -871,7 +872,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
871
872
try body
872
873
catch {
873
874
case ex : Throwable =>
874
- ctx .error(i """ |compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
875
+ report .error(i """ |compiler bug: created invalid generic signature for $sym in ${sym.denot.owner.showFullName}
875
876
|signature: $sig
876
877
|if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues
877
878
""" .trim, sym.sourcePos)
@@ -922,7 +923,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
922
923
}
923
924
924
925
def abort (msg : String ): Nothing = {
925
- ctx .error(msg)
926
+ report .error(msg)
926
927
throw new RuntimeException (msg)
927
928
}
928
929
0 commit comments