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.
2 parents 44333f6 + 7959821 commit dd26e39Copy full SHA for dd26e39
tests/run/i12032.check
@@ -0,0 +1,2 @@
1
+foo
2
+bar
tests/run/i12032.scala
@@ -0,0 +1,24 @@
+// https://github.com/lampepfl/dotty/issues/12032
+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
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)
0 commit comments