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

Make raise statements show the correct function name #138

Merged
merged 8 commits into from
May 26, 2024
Merged

Make raise statements show the correct function name #138

merged 8 commits into from
May 26, 2024

Conversation

angelcaru
Copy link
Contributor

Closes #137

@Almas-Ali
Copy link
Member

This should also accept just function name. Ex. raise somefile.TypeError without ().

@Almas-Ali
Copy link
Member

It would be nice to get like this:

Radiation (most recent call last):
  File ./test_lib.rn, line 3
TypeError

raise rlib.TypeError
      ^^^^^^^^^^^^^^

if called rlib.TypeError this only. no arguments and no default will be executed while no ().

@angelcaru
Copy link
Contributor Author

angelcaru commented May 25, 2024

What, like this?

TypeError = "type error"
raise TypeError

instead of

fun TypeError() {
    return "type error"
}
raise TypeError

@Almas-Ali
Copy link
Member

What, like this?

TypeError = "type error"
raise TypeError

instead of

fun TypeError() {
    return "type error"
}
raise TypeError
Radiation (most recent call last):
  File ./test_lib.rn, line 6, in <program>
RuntimeError: Illegal operation for ("type error", "type error")

raise TypeError
      ^^^^^^^^^

@angelcaru
Copy link
Contributor Author

OK, now I'm even more confused

@angelcaru
Copy link
Contributor Author

So if the function returns null don't print a message? So

fun TypeError() {
    return "type error"
}
raise TypeError

would give TypeError: type error, while

fun TypeError() {} # implicitly returns null
raise TypeError

would give TypeError?

@Almas-Ali
Copy link
Member

When it is not defined yet, it raise errors 2 times. It could be for the super() call on error file.

Radiation (most recent call last):
  File ./test_lib.rn, line 3, in <program>
Radiation (most recent call last):
  File ./test_lib.rn, line 3
RuntimeError: Attribute 'rrError' does not exist

raise rlib.rrError()
      ^^^^^^^^^^^^

raise rlib.rrError()
      ^^^^^^^^^^^^

@Almas-Ali
Copy link
Member

Almas-Ali commented May 26, 2024

Some times it leaves closing parent on error.

Screenshot_2024-05-26_16-55-02

@angelcaru
Copy link
Contributor Author

? Can't reproduce

@Almas-Ali
Copy link
Member

? Can't reproduce

What do you mean?

@angelcaru
Copy link
Contributor Author

What is even the issue?

@Almas-Ali
Copy link
Member

What is even the issue?

Check the last error message on the screenshot.

@angelcaru
Copy link
Contributor Author

It looks fine to me...

@Almas-Ali
Copy link
Member

It missed the closing parenthesis.

@angelcaru
Copy link
Contributor Author

That's such a minor thing though. It doesn't really matter

@Almas-Ali
Copy link
Member

That's such a minor thing though. It doesn't really matter

Well you are right. But this looks weird to me.

@angelcaru
Copy link
Contributor Author

angelcaru commented May 26, 2024

We have all sorts of similar issues with error reporting. I don't see a reason why this one specifically needs to block the PR.
For instance:

@Almas-Ali
Copy link
Member

We have all sorts of similar issues with error reporting. I don't see a reason why this one specifically needs to block the PR. For instance:

I am not blocking the PR here. Just wanted to share my opinion on this related topic.

In this case we need to identify this issue with more various perspective and create a new issue linking all found bugs on radiation traceback formatting to fix it.

@Almas-Ali Almas-Ali merged commit ea42ac3 into radon-project:master May 26, 2024
1 check passed
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.

raise statement inhancement.
2 participants