Skip to content

Commit dd26e39

Browse files
test: add in a regression test for #12032 (#17500)
[skip community_build] closes #12032
2 parents 44333f6 + 7959821 commit dd26e39

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/run/i12032.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
bar

tests/run/i12032.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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)

0 commit comments

Comments
 (0)