Skip to content

Commit 83b703d

Browse files
committed
Add missing dealias in isContextFunctionRef
Fixes #15738
1 parent 6c7acf9 commit 83b703d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3704,7 +3704,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
37043704
missingArgs(wtp)
37053705
}
37063706

3707-
def isContextFunctionRef(wtp: Type): Boolean = wtp match {
3707+
def isContextFunctionRef(wtp: Type): Boolean = wtp.dealias match {
37083708
case RefinedType(parent, nme.apply, _) =>
37093709
isContextFunctionRef(parent) // apply refinements indicate a dependent CFT
37103710
case _ =>

tests/pos/i15738.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
object Test {
2+
trait Transaction
3+
type Transactional[T] = (Transaction) ?=> T
4+
5+
def ff(x: Int): Transactional[Int] = {
6+
//summon[Transaction]
7+
x
8+
}
9+
10+
def fff(x: Int): Transactional[Int] = {
11+
//summon[Transaction]
12+
val x1 = ff(x)
13+
x1
14+
}
15+
16+
}

0 commit comments

Comments
 (0)