We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e83606 commit 2ec3b9aCopy full SHA for 2ec3b9a
compiler/src/dotty/tools/dotc/transform/ContextFunctionResults.scala
@@ -101,8 +101,9 @@ object ContextFunctionResults:
101
def contextFunctionResultTypeAfter(meth: Symbol, depth: Int)(using Context) =
102
def recur(tp: Type, n: Int): Type =
103
if n == 0 then tp
104
- else tp match
+ else tp.dealias match
105
case defn.FunctionTypeOfMethod(mt) => recur(mt.resType, n - 1)
106
+ case _ => tp
107
recur(meth.info.finalResultType, depth)
108
109
/** Should selection `tree` be eliminated since it refers to an `apply`
tests/pos/i21433.scala
@@ -0,0 +1,6 @@
1
+trait A[T]:
2
+ type R = T ?=> Unit
3
+ def f: R = ()
4
+
5
+class B extends A[Int]:
6
+ override def f: R = ()
0 commit comments