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-8002] Failed to infer type of integer literal #50535
Comments
There's the obvious fix of adding @swift-ci create |
cc @xedin |
It's a bad diagnostic. We don't have heterogeneous shifts for the masking shifts, so we should be complaining about the Note that the precedence is and not
Is the lack of heterogenous overloads in this case is intentional, @moiseev? |
Taking a look at |
Well perhaps there is more going on here than I noticed. There is a heterogeneous masking shift in |
@rudkx there are heterogeneous overloads like |
I agree that it looks like the wrong diagnostics, what I think happens is: |
I think there's more than just being a wrong diagnostic: the version without a subtraction |
This was fixed recently on master with #33060 Could you please verify using the latest master toolchain from https://swift.org/download/#snapshots? Thank you! |
@hborla I tested with the DEVELOPMENT-SNAPSHOT-2020-08-07-a snapshot available in swiftenv, and it compiles without errors 🙂 thanks! |
Environment
```
$ swift --version
Swift version 4.2-dev (LLVM 70f121e1f0, Clang 4c555650a6, Swift bb9532c)
Target: x86_64-unknown-linux-gnu
```
Additional Detail from JIRA
md5: cf8329b51c747aa989d37a85c3772d97
Issue Description:
In the following example
Swift is unable to infer the rightmost `1` as `UInt16`.
The text was updated successfully, but these errors were encountered: