-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix global init checker unexpected by name #23859
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
Fix global init checker unexpected by name #23859
Conversation
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.
LGTM
@@ -6,6 +6,6 @@ object Test: | |||
class Box(val x: Int) | |||
|
|||
def recur(a: => Box, b: => Box): Int = | |||
a.x + recur(a: @widen(5), b: @widen(5)) + b.x // warn // warn | |||
a.x + recur(a: @widen(5), b: @widen(5)) + b.x | |||
|
|||
recur(Box(1), Box(2)) |
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 can drop this test, it's the same as the other one. The widen
annotation does not have a meaning in the new analysis anymore.
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.
Since we still have the annotation, we can keep the test in case we start using the annotation again.
If we decide to remove the annotation at some point, we can have a PR that changes all the tests that use the annotation.
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.
LGTM too.
@@ -6,6 +6,6 @@ object Test: | |||
class Box(val x: Int) | |||
|
|||
def recur(a: => Box, b: => Box): Int = | |||
a.x + recur(a: @widen(5), b: @widen(5)) + b.x // warn // warn | |||
a.x + recur(a: @widen(5), b: @widen(5)) + b.x | |||
|
|||
recur(Box(1), Box(2)) |
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.
Since we still have the annotation, we can keep the test in case we start using the annotation again.
If we decide to remove the annotation at some point, we can have a PR that changes all the tests that use the annotation.
This PR fixes the issue of throwing unexpected by name error in the global object initialization error when the by-name value is a modelled by set of
Fun
. Each element in the value set is recursively evaluated