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