Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Smart inference based on the context, or suffixing literals? #734

Open
felixangell opened this issue Mar 3, 2016 · 2 comments
Open

Smart inference based on the context, or suffixing literals? #734

felixangell opened this issue Mar 3, 2016 · 2 comments
Labels

Comments

@felixangell
Copy link
Member

Something I'm constantly doing is casting values in cases where it's obvious and the compiler can easily infer the type based on the context. The proposal here is that we either have suffixes for each type, for instance u or s for annotating a signed and unsigned literal. Or we can infer the type of the literal based on the context of the expression.

I'm fine with either, or both, but I think not having any at all is a huge pain when writing code.

@MovingtoMars
Copy link
Member

Just go mut i: usize;.

@felixangell
Copy link
Member Author

That's not the primary reason of this issue.
The real issue is based on arithmetic or comparisons with certain types and literals. I'm pretty sure that a bug is what caused this, and had this have worked as intended, I wouldn't have made this issue.
In other words, this issue is now irrelevant, there are some bugs with arithmetic and comparisons on certain types I need to hunt down and report... unless this is how it's intended to be, in which case this issue still applies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants