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

IllegalAccessError for package-private super-interface #1430

Closed
scabug opened this issue Oct 17, 2008 · 5 comments
Closed

IllegalAccessError for package-private super-interface #1430

scabug opened this issue Oct 17, 2008 · 5 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Oct 17, 2008

package test1;
interface Foo {
   public void foo();
}
public interface Bar extends Foo {
   public void bar();
}

and Scala

package test2
class Baz(x: Bar) {
  x.foo
}

Scalac generates bytecode referencing Foo.foo instead of the most specific Bar.foo, which results in an IllegalAccessError at runtime.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 17, 2008

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 28, 2011

Commit Message Bot (anonymous) said:
(extempore in r26078) Fix for erroneous bytecode generation.

A remedy for an IllegalAccessError where generated bytecode
referred to an inaccessible type. Closes #1430.

Bonus materials:

  • tore out all the invokedynamic support. The shipped jdk7
    implementation shows limited resemblance to the one this was written
    against; the code mostly serves to distract. (I think I could get
    invokedynamic working pretty quickly, except that it would
    mean having a codebase for java7 and one for 5-6, which is not a yak
    I wish to shave today.)

  • gave NullClass and NothingClass objects of their own, which
    allowed a nice polymorphic simplification of isSubClass, plus a
    couple other streamlinings.

@scabug scabug closed this Nov 28, 2011
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 14, 2013

@Blaisorblade said:
In the above example, it's intended that Bar extends Foo, isn't it? I'm asking because this is related to #7253.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 14, 2013

@paulp said:
Oh, yes, indeed it makes no sense without Bar extending Foo.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Mar 14, 2013

@paulp said:
I updated it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.