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

Function that only throws exception is expected to have bool return type #2012

Open
toinehartman opened this issue Jul 24, 2024 · 2 comments
Assignees

Comments

@toinehartman
Copy link

Describe the bug

A function that only throws an exception, is expected to have return type bool.

To Reproduce

str f() = {
  throw "Not implemented"; // error: Return type `str` expected, found `bool`
};

Expected behavior
I would expect this to be fine.
In general, this might require dataflow analysis. But this simple case was fine in the previous typechecker release and should be supported, I think.

Desktop (please complete the following information):

  • Context: VS Code plugin 0.12.0-head1137
  • Rascal Version 0.40.7
Copy link
Member

Good find. I will have a look at this.

@toinehartman
Copy link
Author

I was testing out my rename refactoring implementation on bird, when it popped up.

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

2 participants