File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1466,7 +1466,7 @@ object SymDenotations {
14661466 val builder = new BaseDataBuilder
14671467 for (p <- classParents) {
14681468 if (p.typeSymbol.isClass) builder.addAll(p.typeSymbol.asClass.baseClasses)
1469- else assert(ctx.mode.is(Mode .Interactive ), s " $this has non-class parent: $p" )
1469+ else assert(isRefinementClass || ctx.mode.is(Mode .Interactive ), s " $this has non-class parent: $p" )
14701470 }
14711471 (classSymbol :: builder.baseClasses, builder.baseClassSet)
14721472 }
Original file line number Diff line number Diff line change @@ -1967,6 +1967,7 @@ object Types {
19671967 def derivedSelect (prefix : Type )(implicit ctx : Context ): Type =
19681968 if (prefix eq this .prefix) this
19691969 else if (prefix.isBottomType) prefix
1970+ else if (prefix.isInstanceOf [WildcardType ]) WildcardType
19701971 else if (isType) {
19711972 val res =
19721973 if (currentSymbol.is(ClassTypeParam )) argForParam(prefix)
Original file line number Diff line number Diff line change 1+ // Used to crash with:
2+ // assertion failed: class <refinement> has non-class parent
3+ // Once that was fixed, another crash with:
4+ // assertion failed: invalid prefix WildcardType(NoType)
5+ object runtime1 {
6+
7+ trait TypeClass1 [A ] {
8+ val common : TypeClassCommon1
9+ type This [X ] = common.This [X ]
10+ }
11+
12+ trait TypeClassCommon1 { self =>
13+ type This [X ]
14+ type Instance [X ] <: TypeClass1 [X ]
15+ def inject [A ](x : This [A ]): Instance [A ]// { val common: self.type }
16+ }
17+
18+ trait Extension1 [From [_], To [X ] <: TypeClass1 [X ]] extends TypeClassCommon1 {
19+ type This [X ] = From [X ]
20+ type Instance [X ] = To [X ]
21+ }
22+
23+ implicit def inject [A , From [_]](x : From [A ])
24+ (implicit ev : Extension1 [From , _]): ev.Instance [A ] { type This [X ] = From [X ] } =
25+ ev.inject(x) // error: found: ev.To[A], required: ev.To[A]{This = From}
26+ }
You can’t perform that action at this time.
0 commit comments