File tree 2 files changed +17
-9
lines changed
compiler/src/dotty/tools/dotc/typer
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -3730,16 +3730,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3730
3730
missingArgs(wtp)
3731
3731
}
3732
3732
3733
- def isContextFunctionRef (wtp : Type ): Boolean = wtp match {
3734
- case RefinedType (parent, nme.apply, _) =>
3735
- isContextFunctionRef(parent) // apply refinements indicate a dependent CFT
3736
- case _ =>
3737
- val underlying = wtp.underlyingClassRef(refinementOK = false ) // other refinements are not OK
3738
- defn.isContextFunctionClass(underlying.classSymbol)
3739
- }
3740
-
3741
3733
def adaptNoArgsOther (wtp : Type , functionExpected : Boolean ): Tree = {
3742
- val implicitFun = isContextFunctionRef (wtp) && ! untpd.isContextualClosure(tree)
3734
+ val implicitFun = defn.isContextFunctionType (wtp) && ! untpd.isContextualClosure(tree)
3743
3735
def caseCompanion =
3744
3736
functionExpected &&
3745
3737
tree.symbol.is(Module ) &&
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ trait Transaction
3
+ type Transactional [T ] = (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
+ }
You can’t perform that action at this time.
0 commit comments