diff options
Diffstat (limited to 'compiler/src/dotty')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/TypeApplications.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 23c3f96cc..94b726491 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -391,9 +391,12 @@ class TypeApplications(val self: Type) extends AnyVal { if (!args.exists(_.isInstanceOf[TypeBounds])) { val followAlias = Config.simplifyApplications && { dealiased.resType match { - case AppliedType(tyconBody, _) => - sameLength(dealiased.typeParams, tyconBody.typeParams) - // Reducing is safe for type inference, as kind arity of type constructor does not change + case AppliedType(tyconBody, dealiasedArgs) => + // Reduction should not affect type inference when it's + // just eta-reduction (ignoring variance annotations). + // See i2201*.scala for examples where more aggressive + // reduction would break type inference. + dealiased.paramRefs == dealiasedArgs case _ => false } } |