File tree 1 file changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -5965,8 +5965,15 @@ object Types extends TypeUtils {
5965
5965
case _ => false
5966
5966
def validCtor (cls : Symbol ): Boolean =
5967
5967
val ctor = cls.primaryConstructor
5968
- (! ctor.exists || zeroParams(ctor.info)) // `ContextFunctionN` does not have constructors
5969
- && (! cls.is(Trait ) || validCtor(cls.info.parents.head.classSymbol))
5968
+ if ! ctor.exists then true // `ContextFunctionN` does not have constructors
5969
+ else if ! zeroParams(ctor.info) then false
5970
+ else if ! cls.is(Trait ) then true
5971
+ else
5972
+ val firstParentCls = cls.info.parents.head.classSymbol
5973
+ if firstParentCls.isClass && ! firstParentCls.is(Trait ) then
5974
+ validCtor(firstParentCls) // need to check class constructor as well
5975
+ else
5976
+ true
5970
5977
val validCtorNEW = validCtor(tp.cls)
5971
5978
5972
5979
if validCtorNEW != validCtorOLD then
You can’t perform that action at this time.
0 commit comments