@@ -57,25 +57,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
57
57
58
58
val primitives = new DottyPrimitives (ctx)
59
59
60
- def isRuntimeVisible (annot : Annotation ): Boolean =
61
- if (toDenot(annot.tree.tpe.typeSymbol).hasAnnotation(AnnotationRetentionAttr ))
62
- retentionPolicyOf(annot) == AnnotationRetentionRuntimeAttr
63
- else {
64
- // SI-8926: if the annotation class symbol doesn't have a @RetentionPolicy annotation, the
65
- // annotation is emitted with visibility `RUNTIME`
66
- // dotty bug: #389
67
- true
68
- }
69
-
70
- def shouldEmitAnnotation (annot : Annotation ): Boolean = {
71
- annot.symbol.is(Flags .JavaDefined ) &&
72
- retentionPolicyOf(annot) != AnnotationRetentionSourceAttr
73
- }
74
-
75
- private def retentionPolicyOf (annot : Annotation ): Symbol =
76
- annot.tree.tpe.typeSymbol.getAnnotation(AnnotationRetentionAttr ).
77
- flatMap(_.argumentConstant(0 ).map(_.symbolValue)).getOrElse(AnnotationRetentionClassAttr )
78
-
79
60
private def erasureString (clazz : Class [_]): String = {
80
61
if (clazz.isArray) " Array[" + erasureString(clazz.getComponentType) + " ]"
81
62
else clazz.getName
@@ -97,12 +78,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
97
78
def sourcePos (pos : Spans .Span )(implicit ctx : Context ): util.SourcePosition =
98
79
ctx.source.atSpan(pos)
99
80
100
- def dumpClasses : Option [String ] =
101
- if (ctx.settings.Ydumpclasses .isDefault) None
102
- else Some (ctx.settings.Ydumpclasses .value)
103
-
104
- def debuglevel : Int = 3 // 0 -> no debug info; 1-> filename; 2-> lines; 3-> varnames
105
-
106
81
val perRunCaches : Caches = new Caches {
107
82
def newAnyRefMap [K <: AnyRef , V ](): mutable.AnyRefMap [K , V ] = new mutable.AnyRefMap [K , V ]()
108
83
def newWeakMap [K , V ](): mutable.WeakHashMap [K , V ] = new mutable.WeakHashMap [K , V ]()
@@ -112,9 +87,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
112
87
def newSet [K ](): mutable.Set [K ] = new mutable.HashSet [K ]
113
88
}
114
89
115
- def dropModule (str : String ): String =
116
- if (! str.isEmpty && str.last == '$' ) str.take(str.length - 1 ) else str
117
-
118
90
private val desugared = new java.util.IdentityHashMap [Type , tpd.Select ]
119
91
120
92
def desugarIdentBI (i : Ident ): Option [tpd.Select ] = {
@@ -130,16 +102,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
130
102
if (found == null ) None else Some (found)
131
103
}
132
104
133
- // todo: remove
134
- def isMaybeBoxed (sym : Symbol ): Boolean = {
135
- (sym == defn.ObjectClass ) ||
136
- (sym == defn.JavaSerializableClass ) ||
137
- (sym == defn.ComparableClass ) ||
138
- (sym derivesFrom defn.BoxedNumberClass ) ||
139
- (sym derivesFrom defn.BoxedCharClass ) ||
140
- (sym derivesFrom defn.BoxedBooleanClass )
141
- }
142
-
143
105
// @M don't generate java generics sigs for (members of) implementation
144
106
// classes, as they are monomorphic (TODO: ok?)
145
107
private final def needsGenericSignature (sym : Symbol ): Boolean = ! (
@@ -318,21 +280,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
318
280
}
319
281
else Nil
320
282
321
- /**
322
- * All interfaces implemented by a class, except for those inherited through the superclass.
323
- * Redundant interfaces are removed unless there is a super call to them.
324
- */
325
- def superInterfaces : List [Symbol ] = {
326
- val directlyInheritedTraits = decorateSymbol(sym).directlyInheritedTraits
327
- val directlyInheritedTraitsSet = directlyInheritedTraits.toSet
328
- val allBaseClasses = directlyInheritedTraits.iterator.flatMap(_.asClass.baseClasses.drop(1 )).toSet
329
- val superCalls = superCallsMap.getOrElse(sym, Set .empty)
330
- val additional = (superCalls -- directlyInheritedTraitsSet).filter(_.is(Flags .Trait ))
331
- // if (additional.nonEmpty)
332
- // println(s"$fullName: adding supertraits $additional")
333
- directlyInheritedTraits.filter(t => ! allBaseClasses(t) || superCalls(t)) ++ additional
334
- }
335
-
336
283
/**
337
284
* True for module classes of package level objects. The backend will generate a mirror class for
338
285
* such objects.
@@ -353,33 +300,6 @@ class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap
353
300
}
354
301
}
355
302
356
-
357
- /**
358
- * This is basically a re-implementation of sym.isStaticOwner, but using the originalOwner chain.
359
- *
360
- * The problem is that we are interested in a source-level property. Various phases changed the
361
- * symbol's properties in the meantime, mostly lambdalift modified (destructively) the owner.
362
- * Therefore, `sym.isStatic` is not what we want. For example, in
363
- * object T { def f { object U } }
364
- * the owner of U is T, so UModuleClass.isStatic is true. Phase travel does not help here.
365
- */
366
- def isOriginallyStaticOwner : Boolean =
367
- sym.is(Flags .PackageClass ) || sym.is(Flags .ModuleClass ) && symHelper(symHelper(sym.originalOwner).originalLexicallyEnclosingClass).isOriginallyStaticOwner
368
- }
369
-
370
-
371
- /** The members of this type that have all of `required` flags but none of `excluded` flags set.
372
- * The members are sorted by name and signature to guarantee a stable ordering.
373
- */
374
- def sortedMembersBasedOnFlags (tp : Type , required : Flags .Flag , excluded : Flags .FlagSet ): List [Symbol ] = {
375
- // The output of `memberNames` is a Set, sort it to guarantee a stable ordering.
376
- val names = tp.memberNames(takeAllFilter).toSeq.sorted
377
- val buffer = mutable.ListBuffer [Symbol ]()
378
- names.foreach { name =>
379
- buffer ++= tp.memberBasedOnFlags(name, required, excluded)
380
- .alternatives.sortBy(_.signature)(Signature .lexicographicOrdering).map(_.symbol)
381
- }
382
- buffer.toList
383
303
}
384
304
385
305
object SelectBI extends DeconstructorCommon [tpd.Tree ] {
0 commit comments