@@ -1599,12 +1599,11 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
15991599
16001600 def cookIfNeeded (tpt : Tree ) = if (context.unit.isJava) tpt modifyType rawToExistential else tpt
16011601 cookIfNeeded(if (probe.isTrait || inMixinPosition) {
1602- if (! argssAreTrivial) {
1603- if (probe.isTrait) ConstrArgsInParentWhichIsTraitError (encodedtpt, probe)
1604- else () // a class in a mixin position - this warrants an error in `validateParentClasses`
1602+ if (probe.isTrait && inMixinPosition && ! argss.isEmpty)
1603+ ConstrArgsInParentWhichIsTraitError (encodedtpt, probe)
1604+ // a class in a mixin position - this warrants an error in `validateParentClasses`
16051605 // therefore here we do nothing, e.g. don't check that the # of ctor arguments
16061606 // matches the # of ctor parameters or stuff like that
1607- }
16081607 typedType(decodedtpt)
16091608 } else {
16101609 val supertpt = typedTypeConstructor(decodedtpt)
@@ -1757,8 +1756,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
17571756 case Nil => List (atPos(templ.pos)(TypeTree (AnyRefTpe )))
17581757 case first :: rest =>
17591758 try {
1759+ val firstMixin = ! context.owner.isAnonymousClass // permit new T() {} syntax
17601760 val supertpts = fixDuplicateSyntheticParents(normalizeFirstParent(
1761- typedParentType(first, templ, inMixinPosition = false ) +:
1761+ typedParentType(first, templ, inMixinPosition = firstMixin ) +:
17621762 (rest map (typedParentType(_, templ, inMixinPosition = true )))))
17631763
17641764 // if that is required to infer the targs of a super call
0 commit comments