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

Assign different error code to break without value #387

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

soutaro
Copy link
Owner

@soutaro soutaro commented Jun 26, 2021

Breaking without value often happens and causes type errors.

[1,2,3].each do |i|
  break      # Type error because the #each method expects Array[Integer]
end

This cannot be handled well under the current type checker architecture, so assigning another error code would help to ignore this type errors if the user wants it.

@soutaro soutaro merged commit 0b0d8c3 into master Jun 26, 2021
@soutaro soutaro deleted the break-without-value branch June 26, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant