-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2869: Have constructors run after group of Memoize #2870
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
private final java.lang.String MT.s |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class MT(sf: MT => String) { | ||
// `s` is retained as a field, but `sf` should not be. | ||
val s = sf(this) | ||
} | ||
object Test extends App { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we've deprecated/discouraged the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but I am not sure why? I hate to write all these main methods. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #559 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am still not sure why we use LegacyApp instead of App now. They seem to be equivalent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /cc @DarkDimius do you remember why LegacyApp had to be introduced? |
||
def printFields(obj: Any) = | ||
println(obj.getClass.getDeclaredFields.map(_.toString).sorted.deep.mkString("\n")) | ||
printFields(new MT(_ => "")) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Fields of A: | ||
private final int A.a | ||
private final int A.b | ||
private final scala.Tuple2 A.$1$ | ||
# Methods of A: | ||
public int A.a() | ||
public int A.b() |
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 was this condition dropped?
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.
It is (probably) dead code. The test looks non-sensical to me. I fail to see how a definition of a class member can end up as something like this:
Even if it did, why would it make a difference? I put in an assert to flag the condition, but it never triggered in all our tests.