Skip to content
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

[SR-13584] Make convenience methods returning an the value of an integer literal as Int and of floating literal as Float return an optional #405

Open
swift-ci opened this issue Sep 22, 2020 · 4 comments · May be fixed by #2605
Assignees
Labels
enhancement New feature or request SwiftParser Bugs in the (new) Parser written in Swift

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-13584
Radar None
Original Reporter vermont42 (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s SwiftSyntax
Labels Bug
Assignee vermont42 (JIRA)
Priority Medium

md5: 14ad515b7c276d59a1dd762b567c3a4b

Issue Description:

After the PR for SR-11580 merged, there was consensus, based on feedback, that the new convenience methods floatingValue and integerValue, should be optional in order to prevent potential crashes. This story is for implementation of this change. There was additional feedback involving naming and genericity. Depending on PR-review feedback, this story may encompass implementation of these changes as well.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@ahoppen ahoppen changed the title [SR-13584] Implement Additional Feedback on New SwiftSyntax Convenience Methods [SR-13584] Make convenience methods returning an the value of an integer literal as Int and of floating literal as Float return an optional Jun 21, 2022
@ahoppen
Copy link
Collaborator

ahoppen commented Jun 21, 2022

rdar://95634857

@ahoppen ahoppen added SwiftParser Bugs in the (new) Parser written in Swift enhancement New feature or request and removed bug Something isn't working labels Jun 22, 2023
@ahoppen
Copy link
Collaborator

ahoppen commented Jun 22, 2023

If anyone is interested in doing this: We would need to port the following code to Swift for the integer literal:

https://github.com/apple/swift/blob/15f7a28ff3fb6427438d3dcc9d2111fb82f85023/lib/AST/Expr.cpp#L1078-L1167

@kimdv kimdv self-assigned this Apr 13, 2024
@kimdv
Copy link
Collaborator

kimdv commented Apr 13, 2024

@ahoppen I could be interested in this, if it's still needed.

@ahoppen
Copy link
Collaborator

ahoppen commented Apr 15, 2024

Yes, I think this would still be great to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SwiftParser Bugs in the (new) Parser written in Swift
Projects
None yet
4 participants