-
Notifications
You must be signed in to change notification settings - Fork 413
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
dyno: resolve nested init calls #24906
Merged
DanilaFe
merged 14 commits into
chapel-lang:main
from
DanilaFe:resolve-nested-init-calls
Apr 24, 2024
Merged
dyno: resolve nested init calls #24906
DanilaFe
merged 14 commits into
chapel-lang:main
from
DanilaFe:resolve-nested-init-calls
Apr 24, 2024
Conversation
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
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Also emit errors for fields initialized before 'this.init()' call. Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
This should make it easier to test non-one stride kinds Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
benharsh
approved these changes
Apr 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #24854. Closes https://github.com/Cray/chapel-private/issues/6182 (sprint task).
This PR adjusts the
InitResolver
to support calls likethis.init
inside otherinit
procedures.To make this work, the PR does the following things:
main
-- is now illegal.InitResolver
to syntactically detect calls such asthis.init()
. By doing this, in turn, we can start representing their effects on the resolution state.InitResolver
that operate onCallResolutionResult
s in addition to AST nodes. This is required because the effects of callingthis.init
depend on which overload ofinit
is called; as such, we want to go through the usual mechanism for resolving the initializer. Doing so usingCallResolutionResult
s makes the most sense. As a result of this PR, thehandleCallExpr
follows up resolution withhandleResoledCall
, which descends into theInitResolver.
init
, theInitResolver
populates the individual field states as if they were assigned to. This is useful because the calls to 'this.init' need to fit into the existing framework of initialization: handling branches, merging intermediate results, etc.handleCallExpr
to stop skipping call resolution when the receiver formal is generic. Thethis
inthis.init
for a generic method is going to be generic, but that should not stop us from performing resolution.As a result, #24854 is resolved; a major consequence of that is that ranges with the
by
operator (mentioned in #24853) now resolve correctly: the constructor that previously threw away thestride
now properly takes it into account. I was able to validate that the implementation of ranges in Dyno works with strides as one would expect.Reviewed by @benharsh -- thanks!
Testing