File tree 3 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/ast
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -824,7 +824,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
824
824
case _ => tree
825
825
}
826
826
827
- /** An extractor for eta expanded `mdef` an eta-expansion of a method reference? To recognize this, we use
827
+ /** Is `mdef` an eta-expansion of a method reference? To recognize this, we use
828
828
* the following criterion: A method definition is an eta expansion, if
829
829
* it contains at least one term paramter, the parameter has a zero extent span,
830
830
* and the right hand side is either an application or a closure with'
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def test(c: Cap, other: String): Unit =
13
13
val x3a : () -> String = s1
14
14
val s2 = () => if x1 == null then " " else " abc"
15
15
val x4 : C ^ {s2} = ??? // OK
16
- val x5 : C ^ {c, c} = ??? // error: redundant
16
+ val x5 : C ^ {c, c} = ??? // error: redundant // error: redundant
17
17
// val x6: C^{c}^{c} = ??? // would be syntax error
18
18
val x7 : Cap ^ {c} = ??? // error: redundant
19
19
// val x8: C^{c}^{cap} = ??? // would be syntax error
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ object Monomorphic2:
38
38
def fst : Cap ^ {cap[Pair ]} -> {x} Unit = x
39
39
def snd : Cap ^ {cap[Pair ]} -> {y} Unit = y
40
40
41
+ class Pair2 (x : Cap => Unit , y : Cap => Unit ):
42
+ def fst : Cap ^ {cap[Pair2 ]} => Unit = x
43
+ def snd : Cap ^ {cap[Pair2 ]} => Unit = y
44
+
41
45
def test (c : Cap , d : Cap ) =
42
46
def f (x : Cap ): Unit = if c == x then ()
43
47
def g (x : Cap ): Unit = if d == x then ()
@@ -46,3 +50,4 @@ object Monomorphic2:
46
50
val x1c : Cap -> {c} Unit = x1
47
51
val y1 = p.snd
48
52
val y1c : Cap -> {d} Unit = y1
53
+
You can’t perform that action at this time.
0 commit comments