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

Fix incorrect type of Int#times iterator #5038

Merged
merged 1 commit into from Sep 26, 2017
Merged

Fix incorrect type of Int#times iterator #5038

merged 1 commit into from Sep 26, 2017

Conversation

asterite
Copy link
Member

@asterite asterite commented Sep 26, 2017

Fixes #5019

@asterite asterite self-assigned this Sep 26, 2017
Copy link
Member

@bcardiff bcardiff left a comment

Sounds good. Maybe there should be a spec for lower types (Int8). Given that Int8 + Int32 today gives an Int8 this works. Otherwise the + 1 in #next should change also.

@mverzilli mverzilli added this to the Next milestone Sep 26, 2017
@asterite
Copy link
Member Author

@asterite asterite commented Sep 26, 2017

We generally have the rule that T op U has type T, so x += 1 will always preserve the type of x. If we later change that rule we can add more specs (I think the current spec will fail if we do so).

@asterite asterite merged commit 1c859ca into crystal-lang:master Sep 26, 2017
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants