We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b58799e commit 2711b4cCopy full SHA for 2711b4c
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 = ???
3
+ f(true)
4
+}
0 commit comments