-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat: resolve java types against namespace imports in try-catch
#7902
feat: resolve java types against namespace imports in try-catch
#7902
Conversation
@magnus-madsen quick review? Still need to add documentation |
@jaschdoc The future plan is that all Java types must be imported. So its totally fine if you just do a look up in the environment like in InvokeStaticMethod2. |
Hmm |
Can we do the exceptions first and then later the instanceof? |
I will update tests and std lib in smaller PRs related to #7872 |
try-catch
* Returns the class reflection object for the given `className`. | ||
*/ | ||
private def lookupJvmClass2(className: String, env0: ListMap[String, Resolution], loc: SourceLocation)(implicit flix: Flix): Result[Class[_], ResolutionError with Recoverable] = { | ||
lookupJvmClass(className, loc) match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, in the future this extra lookup should go away... But. that of course requires refactoring more code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point being that all Java classes and interfaces must be imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but wanted to do this in a soft way so I can progress on the Java import issue before breaking everything :)
Related to #7901
Related to #7872
Related to #7897