@@ -291,26 +291,28 @@ trait TypeAssigner {
291
291
292
292
def assignType (tree : untpd.Super , qual : Tree , inConstrCall : Boolean , mixinClass : Symbol = NoSymbol )(implicit ctx : Context ) = {
293
293
val mix = tree.mix
294
- val qtype @ ThisType (_) = qual.tpe
295
- val cls = qtype.cls
296
-
297
- def findMixinSuper (site : Type ): Type = site.parents filter (_.name == mix.name) match {
298
- case p :: Nil =>
299
- p
300
- case Nil =>
301
- errorType(SuperQualMustBeParent (mix, cls), tree.pos)
302
- case p :: q :: _ =>
303
- errorType(" ambiguous parent class qualifier" , tree.pos)
294
+ qual.tpe match {
295
+ case err : ErrorType => untpd.cpy.Super (tree)(qual, mix).withType(err)
296
+ case qtype @ ThisType (_) =>
297
+ val cls = qtype.cls
298
+ def findMixinSuper (site : Type ): Type = site.parents filter (_.name == mix.name) match {
299
+ case p :: Nil =>
300
+ p
301
+ case Nil =>
302
+ errorType(SuperQualMustBeParent (mix, cls), tree.pos)
303
+ case p :: q :: _ =>
304
+ errorType(" ambiguous parent class qualifier" , tree.pos)
305
+ }
306
+ val owntype =
307
+ if (mixinClass.exists) mixinClass.typeRef
308
+ else if (! mix.isEmpty) findMixinSuper(cls.info)
309
+ else if (inConstrCall || ctx.erasedTypes) cls.info.firstParent
310
+ else {
311
+ val ps = cls.classInfo.parentsWithArgs
312
+ if (ps.isEmpty) defn.AnyType else ps.reduceLeft((x : Type , y : Type ) => x & y)
313
+ }
314
+ tree.withType(SuperType (cls.thisType, owntype))
304
315
}
305
- val owntype =
306
- if (mixinClass.exists) mixinClass.typeRef
307
- else if (! mix.isEmpty) findMixinSuper(cls.info)
308
- else if (inConstrCall || ctx.erasedTypes) cls.info.firstParent
309
- else {
310
- val ps = cls.classInfo.parentsWithArgs
311
- if (ps.isEmpty) defn.AnyType else ps.reduceLeft((x : Type , y : Type ) => x & y)
312
- }
313
- tree.withType(SuperType (cls.thisType, owntype))
314
316
}
315
317
316
318
def assignType (tree : untpd.Apply , fn : Tree , args : List [Tree ])(implicit ctx : Context ) = {
0 commit comments