From 5079ffe722b915b635cbd95b3238b65b5df3df34 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 17 Mar 2021 12:25:44 +0100 Subject: [PATCH] Add missing case to couldInstantiateTypeVar Fixes #11778 --- compiler/src/dotty/tools/dotc/typer/Inferencing.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 18a181c6667a..59ee126f382d 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -102,7 +102,7 @@ object Inferencing { case AppliedType(tycon, args) => // The argument in `args` that may potentially appear directly as result // and thereby influence the members of this type - def argsInResult: List[Type] = tycon match + def argsInResult: List[Type] = tycon.stripTypeVar match case tycon: TypeRef => tycon.info match case MatchAlias(_) => args @@ -114,6 +114,7 @@ object Inferencing { }.toList case _ => Nil case _ => Nil + case _ => Nil couldInstantiateTypeVar(tycon) || argsInResult.exists(couldInstantiateTypeVar) case RefinedType(parent, _, _) =>