Skip to content
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

Field restriction goes too far in 2.12 #10136

Open
scabug opened this issue Jan 6, 2017 · 2 comments
Open

Field restriction goes too far in 2.12 #10136

scabug opened this issue Jan 6, 2017 · 2 comments
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) should compile valueclass
Milestone

Comments

@scabug
Copy link

scabug commented Jan 6, 2017

This compiles and works in 2.11.8, does not compile in 2.12.

trait Foo extends Any {
  val self: String
}
final class Bar(val self: String) extends AnyVal with Foo

Bar is included only to demonstrate that a universal trait with an abstract val is perfectly useful.

In 2.12 it fails with "error: field definition is not allowed in universal trait extending from class Any"

@scabug
Copy link
Author

scabug commented Jan 6, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10136?orig=1
Reporter: @paulp
Affected Versions: 2.12.0, 2.12.1

@scabug
Copy link
Author

scabug commented Jan 8, 2017

@dwijnand said:
Regressed in scala/scala@df36891#diff-b0ef0bb8bad267f2f13f569b598215fd (one of the "fields" phase PRs)

@som-snytt som-snytt added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Apr 4, 2022
@SethTisue SethTisue added this to the Backlog milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) should compile valueclass
Projects
None yet
Development

No branches or pull requests

5 participants