File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ foo
2
+ bar
Original file line number Diff line number Diff line change
1
+ // https://github.com/lampepfl/dotty/issues/12032
2
+ class Foo (val strings : Seq [String ]) extends FooLowPriority
3
+
4
+ trait FooLowPriority { self : Foo =>
5
+ @ scala.annotation.targetName(" appendFromProducers" )
6
+ def append (v : String ): Foo = new Foo (v +: self.strings)
7
+ }
8
+
9
+ trait FooBar { self : Foo =>
10
+ @ scala.annotation.targetName(" appendFromProducers" )
11
+ final override def append (v : String ): Foo = new Foo (self.strings :+ v)
12
+ }
13
+
14
+ object Foo {
15
+ type Bar = Foo with FooBar
16
+
17
+ def bar (vs : String * ): Bar = new Foo (vs) with FooBar
18
+ }
19
+
20
+ @ main def Test () =
21
+ Foo .bar(" foo" )
22
+ .append(" bar" )
23
+ .strings
24
+ .foreach(println)
You can’t perform that action at this time.
0 commit comments