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

Result unwrap cannot find field "java.lang.NoSuchFieldError: field0" #117

Open
jaredlll08 opened this issue Nov 17, 2023 · 1 comment
Open
Milestone

Comments

@jaredlll08
Copy link
Member

jaredlll08 commented Nov 17, 2023

Due to the generic bound on E (<T, E : Exception>), when the bytecode is written, it is written as:

GETFIELD stdlib/Result$Error.field0 : Ljava/lang/Exception;

Which cannot be found as it is declared as:

  // access flags 0x11
  // signature TE;
  // declaration: field0 extends E
  public final Ljava/lang/Object; field0

Repro:

import stdlib.Result;
import stdlib.Exception;

Result<string, Exception>.Error(new Exception("Errored")).unwrap();
@kindlich kindlich added this to the Refactor milestone Jun 8, 2024
@kindlich
Copy link
Member

Should be fixed by #158, let's test this with variants again once that PR is merged.

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

No branches or pull requests

2 participants