Skip to content

test: add in a regression test for #12032 #17500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/run/i12032.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foo
bar
24 changes: 24 additions & 0 deletions tests/run/i12032.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// https://github.com/lampepfl/dotty/issues/12032
class Foo(val strings: Seq[String]) extends FooLowPriority

trait FooLowPriority { self: Foo =>
@scala.annotation.targetName("appendFromProducers")
def append(v: String): Foo = new Foo(v +: self.strings)
}

trait FooBar { self: Foo =>
@scala.annotation.targetName("appendFromProducers")
final override def append(v: String): Foo = new Foo(self.strings :+ v)
}

object Foo {
type Bar = Foo with FooBar

def bar(vs: String*): Bar = new Foo(vs) with FooBar
}

@main def Test() =
Foo.bar("foo")
.append("bar")
.strings
.foreach(println)