@@ -1599,12 +1599,11 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
1599
1599
1600
1600
def cookIfNeeded (tpt : Tree ) = if (context.unit.isJava) tpt modifyType rawToExistential else tpt
1601
1601
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`
1605
1605
// therefore here we do nothing, e.g. don't check that the # of ctor arguments
1606
1606
// matches the # of ctor parameters or stuff like that
1607
- }
1608
1607
typedType(decodedtpt)
1609
1608
} else {
1610
1609
val supertpt = typedTypeConstructor(decodedtpt)
@@ -1757,8 +1756,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
1757
1756
case Nil => List (atPos(templ.pos)(TypeTree (AnyRefTpe )))
1758
1757
case first :: rest =>
1759
1758
try {
1759
+ val firstMixin = ! context.owner.isAnonymousClass // permit new T() {} syntax
1760
1760
val supertpts = fixDuplicateSyntheticParents(normalizeFirstParent(
1761
- typedParentType(first, templ, inMixinPosition = false ) +:
1761
+ typedParentType(first, templ, inMixinPosition = firstMixin ) +:
1762
1762
(rest map (typedParentType(_, templ, inMixinPosition = true )))))
1763
1763
1764
1764
// if that is required to infer the targs of a super call
0 commit comments