File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -419,8 +419,8 @@ object Types {
419
419
/** The type symbol associated with the type */
420
420
@ tailrec final def typeSymbol (using Context ): Symbol = this match {
421
421
case tp : TypeRef => tp.symbol
422
- case tp : ClassInfo => tp.cls
423
422
case tp : TypeProxy => tp.underlying.typeSymbol
423
+ case tp : ClassInfo => tp.cls
424
424
case _ : JavaArrayType => defn.ArrayClass
425
425
case _ => NoSymbol
426
426
}
@@ -430,15 +430,13 @@ object Types {
430
430
* value type, or because superclasses are ambiguous).
431
431
*/
432
432
final def classSymbol (using Context ): Symbol = this match {
433
- case ConstantType (constant) =>
434
- constant.tpe.classSymbol
435
433
case tp : TypeRef =>
436
434
val sym = tp.symbol
437
435
if (sym.isClass) sym else tp.superType.classSymbol
438
- case tp : ClassInfo =>
439
- tp.cls
440
436
case tp : TypeProxy =>
441
437
tp.underlying.classSymbol
438
+ case tp : ClassInfo =>
439
+ tp.cls
442
440
case AndType (l, r) =>
443
441
val lsym = l.classSymbol
444
442
val rsym = r.classSymbol
@@ -456,13 +454,13 @@ object Types {
456
454
/** The least (wrt <:<) set of symbols satisfying the `include` predicate of which this type is a subtype
457
455
*/
458
456
final def parentSymbols (include : Symbol => Boolean )(using Context ): List [Symbol ] = this match {
459
- case tp : ClassInfo =>
460
- tp.cls :: Nil
461
457
case tp : TypeRef =>
462
458
val sym = tp.symbol
463
459
if (include(sym)) sym :: Nil else tp.superType.parentSymbols(include)
464
460
case tp : TypeProxy =>
465
461
tp.underlying.parentSymbols(include)
462
+ case tp : ClassInfo =>
463
+ tp.cls :: Nil
466
464
case AndType (l, r) =>
467
465
l.parentSymbols(include) | r.parentSymbols(include)
468
466
case OrType (l, r) =>
You can’t perform that action at this time.
0 commit comments