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 {
1466
1466
val builder = new BaseDataBuilder
1467
1467
for (p <- classParents) {
1468
1468
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" )
1470
1470
}
1471
1471
(classSymbol :: builder.baseClasses, builder.baseClassSet)
1472
1472
}
Original file line number Diff line number Diff line change @@ -1967,6 +1967,7 @@ object Types {
1967
1967
def derivedSelect (prefix : Type )(implicit ctx : Context ): Type =
1968
1968
if (prefix eq this .prefix) this
1969
1969
else if (prefix.isBottomType) prefix
1970
+ else if (prefix.isInstanceOf [WildcardType ]) WildcardType
1970
1971
else if (isType) {
1971
1972
val res =
1972
1973
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