Navigation Menu

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-8571] Improve type inference for literals #51089

Open
jepers opened this issue Aug 17, 2018 · 1 comment
Open

[SR-8571] Improve type inference for literals #51089

jepers opened this issue Aug 17, 2018 · 1 comment
Labels
compiler The Swift compiler in itself improvement type checker Area → compiler: Semantic analysis

Comments

@jepers
Copy link

jepers commented Aug 17, 2018

Previous ID SR-8571
Radar None
Original Reporter @jepers
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, TypeChecker
Assignee None
Priority Medium

md5: a12180fd4394aadeceda721e274b92d0

Issue Description:

Filed as requested in this forum post.

@rudkx
Copy link
Member

rudkx commented Aug 21, 2018

I think there may be a way to handle this by treating it a little like we treat contextual lookup for something like foo(.staticMember), by treating the .ft part of the expression as if its a lookup into the contextual type if present and if not present falling back to attempting bindings for the literal and then doing the lookup within the literal as done today (this works for the Double case because we first attempt Int for integer literals, and then Double).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants