We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 46956b0 + a0a45b6 commit 1793e86Copy full SHA for 1793e86
compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -418,7 +418,7 @@ object ProtoTypes {
418
419
/** Create a new TypeVar that represents a dependent method parameter singleton */
420
def newDepTypeVar(tp: Type)(implicit ctx: Context): TypeVar =
421
- newTypeVar(TypeBounds.upper(AndType(tp, defn.SingletonClass.typeRef)))
+ newTypeVar(TypeBounds.upper(AndType(tp.widenExpr, defn.SingletonClass.typeRef)))
422
423
/** The result type of `mt`, where all references to parameters of `mt` are
424
* replaced by either wildcards (if typevarsMissContext) or TypeParamRefs.
tests/neg/i3901.scala
@@ -0,0 +1,4 @@
1
+object Crash {
2
+ def f(cond: => Boolean): cond.type = ??? // error: cond is not stable
3
+ f(true)
4
+}
0 commit comments