-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Print val
for class parameters
#4705
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
nicolasstucki
merged 2 commits into
scala:master
from
dotty-staging:decompiled-print-constructor-vals
Jun 22, 2018
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,4 @@ | ||
/** Decompiled from out/posTestFromTasty/pos/simpleConstructor/A.class */ | ||
class A(a: scala.Int, val b: scala.Int, var c: scala.Int) | ||
/** Decompiled from out/posTestFromTasty/pos/simpleConstructor/B.class */ | ||
class B(protected val x: scala.Int, protected[B] val y: scala.Int, private[B] val z: scala.Int) |
This file contains hidden or 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,4 @@ | ||
|
||
class A(a: Int, val b: Int, var c: Int) | ||
|
||
class B(protected val x: Int, protected[B] val y: Int, private[B] val z: Int) |
This file contains hidden or 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,46 @@ | ||
/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box1.class */ | ||
final class Box1(val value: scala.Predef.String) extends scala.AnyVal() { | ||
override def hashCode(): scala.Int = Box1.this.value.hashCode() | ||
override def equals(x$0: scala.Any): scala.Boolean = x$0 match { | ||
case x$0: Box1 @scala.unchecked() => | ||
Box1.this.value.==(x$0.value) | ||
case _ => | ||
false | ||
} | ||
} | ||
object Box1 extends scala.AnyRef() | ||
/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Box2.class */ | ||
final class Box2(val value: scala.Predef.String) extends scala.AnyVal() with Foo { | ||
def box1(x: Box1): scala.Predef.String = "box1: ok" | ||
def box2(x: Box2): scala.Predef.String = "box2: ok" | ||
override def hashCode(): scala.Int = Box2.this.value.hashCode() | ||
override def equals(x$0: scala.Any): scala.Boolean = x$0 match { | ||
case x$0: Box2 @scala.unchecked() => | ||
Box2.this.value.==(x$0.value) | ||
case _ => | ||
false | ||
} | ||
} | ||
object Box2 extends scala.AnyRef() | ||
/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/C.class */ | ||
class C(x: scala.Predef.String) { | ||
def this() = { | ||
this("") | ||
() | ||
} | ||
} | ||
/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Foo.class */ | ||
trait Foo() extends scala.Any { | ||
def box1(x: Box1): scala.Predef.String | ||
def box2(x: Box2): scala.Predef.String | ||
} | ||
/** Decompiled from out/runTestFromTasty/run/valueclasses-pavlov/Test.class */ | ||
object Test { | ||
def main(args: scala.Array[scala.Predef.String]): scala.Unit = { | ||
val b1: Box1 = new Box1("") | ||
val b2: Box2 = new Box2("") | ||
val f: Foo = b2 | ||
scala.Predef.println(f.box1(b1)) | ||
scala.Predef.println(f.box2(b2)) | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why skip
val
(line 641) if we haveoverride
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We skip
val
if we have NOToverride