-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: recover scala 2's semantics for AnyVal under Ycompile-scala2-l…
…ibrary
- Loading branch information
1 parent
4cb43b6
commit 645e822
Showing
6 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[[syntax trees at end of posttyper]] // tests/printing/posttyper/i22533.scala | ||
package <empty> { | ||
@SourceFile("tests/printing/posttyper/i22533.scala") trait A() extends Any { | ||
override def equals(x: Any): Boolean = ??? | ||
override def hashCode(): Int = ??? | ||
} | ||
@SourceFile("tests/printing/posttyper/i22533.scala") final class Foo(u: Int) | ||
extends AnyVal(), A { | ||
override def hashCode(): Int = Foo.this.u.hashCode() | ||
override def equals(x$0: Any): Boolean = | ||
x$0 match | ||
{ | ||
case x$0 @ _:Foo @unchecked => this.u.==(x$0.u) | ||
case _ => false | ||
} | ||
private[this] val u: Int | ||
} | ||
final lazy module val Foo: Foo = new Foo() | ||
@SourceFile("tests/printing/posttyper/i22533.scala") final module class Foo() | ||
extends AnyRef() { this: Foo.type => | ||
private def writeReplace(): AnyRef = | ||
new scala.runtime.ModuleSerializationProxy(classOf[Foo.type]) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-Ycompile-scala2-library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//> using options -Ycompile-scala2-library | ||
|
||
trait A extends Any: | ||
override def equals(x: Any): Boolean = ??? | ||
override def hashCode(): Int = ??? | ||
|
||
class Foo(u: Int) extends AnyVal, A |