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

Error metadata missing on some interop calls #842

Closed
bobisageek opened this issue Nov 27, 2022 · 1 comment · Fixed by #843
Closed

Error metadata missing on some interop calls #842

bobisageek opened this issue Nov 27, 2022 · 1 comment · Fixed by #843

Comments

@bobisageek
Copy link
Contributor

version

master branch

platform

JVM

problem

There are a couple of cases of interop call analysis that "lose" metadata, leading to less detail in the error report (in the case of an error):

  • expanding (.foo x) to (. x foo) (for instance members)
  • getting static fields (using .- notation)

(initially I was just looking at the first one, but when I started writing tests for a PR for the first, it sort of uncovered the second case for me - this is the only reason these somewhat separate cases are grouped)

repro

(Using bb for repros for concision)

  • expanding (.foo x) to (. x foo)
; 'good' case
user=> (. 3 missingMem)
java.lang.NoSuchFieldException: missingMem [at <repl>:1:1]
; 'bad' case
user=> (.missingMem 3)
missingMem
  • getting static fields (using bb -e to illustrate detail that's 'lost')
# 'good' case
$ bb -e "(. Long missingMem)"
----- Error --------------------------------------------------------------------
Type:     java.lang.IllegalArgumentException
Message:  No matching method missingMem found taking 0 args
Location: <expr>:1:1

----- Context ------------------------------------------------------------------
1: (. Long missingMem)
   ^--- No matching method missingMem found taking 0 args

----- Stack trace --------------------------------------------------------------
user - <expr>:1:1

# 'bad' case
$ bb -e "(. Long -missingMem)"
----- Error --------------------------------------------------------------------
Type:     java.lang.IllegalArgumentException
Message:  No matching field found: missingMem for class java.lang.Long

expected behavior

for both cases, expect the 'bad' case to provide a similar level of detail to the 'good' case

notes

I have a PR just about ready that will address both of these; this issue is primarily meant to set context/discuss the problem-ness separately from the code changes.

bobisageek added a commit to bobisageek/sci that referenced this issue Nov 27, 2022
@borkdude
Copy link
Collaborator

PR welcome

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 a pull request may close this issue.

2 participants