-
Notifications
You must be signed in to change notification settings - Fork 419
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
Warn for generic declared return types without (?) #23356
Merged
Merged
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
mppf
changed the title
Warn generic return type no q
Warn for generic declared return types without (?)
Sep 13, 2023
mppf
force-pushed
the
warn-generic-return-type-no-q
branch
from
September 13, 2023 18:55
a1b3598
to
d889ebc
Compare
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
For arrays/ferguson/tuples/t3 --- Signed-off-by: Michael Ferguson <[email protected]>
For constrained-generics/ucol/cwailes-1/confused-arg-error --- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
--- Signed-off-by: Michael Ferguson <[email protected]>
For functions/lydia/declaredGenericReturnType.chpl functions/vass/declaredGenericReturnTuple.chpl --- Signed-off-by: Michael Ferguson <[email protected]>
mppf
force-pushed
the
warn-generic-return-type-no-q
branch
from
September 13, 2023 20:01
a2959cd
to
006ecca
Compare
--- Signed-off-by: Michael Ferguson <[email protected]>
lydia-duncan
approved these changes
Sep 13, 2023
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.
Test changes all look reasonable to me, too!
vasslitvinov
approved these changes
Sep 13, 2023
This was referenced Sep 13, 2023
mppf
added a commit
that referenced
this pull request
Sep 21, 2023
This PR updates the language specification to cover the changes in PRs #23291 #22784 #22745 #23356 where marking a generic type with `(?)` is now needed. This PR adds several new spec sections: * Fields with Generic Types * Fully Defaulted Generic Types * Marking Generic Types Reviewed by @lydia-duncan - thanks!
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.
For https://github.com/Cray/chapel-private/issues/5229 / https://github.com/Cray/chapel-private/issues/4736#issuecomment-1666320252
Continuing #22745 and #23291, this PR adds a warning for routines declared with a generic return type that does not include
(?)
. Note that we already have a number of problems usingdomain
ordomain(?)
as a return or variable type (#23355, #23357, #23358); as a resultdomain(?)
cannot currently be used as a declared return type.While there, this PR adds checking to fix #23346 by making
(?)
on a concrete formal type into a compilation error. It also adds testing for the variable and return type cases to make sure that they also result in a compilation error.For example:
Reviewed by @vasslitvinov and @lydia-duncan - thanks!