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

Relax type-checking of methods when `throw' statement is encountered #86

Closed
rudi opened this issue Aug 6, 2016 · 1 comment
Closed

Comments

@rudi
Copy link
Member

rudi commented Aug 6, 2016


Author Name: Rudolf Schlatte (Rudolf Schlatte)
Original Redmine Issue: 171, https://envisage.ifi.uio.no:8080/redmine/issues/171
Original Date: 2014-11-13
Original Assignee: Rudolf Schlatte


For any method that doesn't return Unit, the type checker expects a return statement of the appropriate value at the end. A method like the following should still be possible:

Int doesntreturn () {
    throw SomeError;
}

The workaround is, of course, to put in a dummy return after the throw.

@rudi
Copy link
Member Author

rudi commented Oct 22, 2018

closing for now; if it bites anyone it will be rediscovered.

@rudi rudi closed this as completed Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant