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

regression in classfile parsing; shows up in android development. #7532

Closed
scabug opened this issue May 30, 2013 · 3 comments
Closed

regression in classfile parsing; shows up in android development. #7532

scabug opened this issue May 30, 2013 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented May 30, 2013

Regressed in: scala/scala@395e90a

% cat !$
% curl --silent http://kriomant.net/scala/android.jar > sandbox/android.jar

% cat sandbox/android.scala
object Test extends App {
  println(android.R.attr.windowBackground)
}

% RUNNER=scalac scala-hash v2.10.2-RC1~75 -classpath sandbox/android.jar sandbox/android.scala
[info] v2.10.2-RC => /Users/jason/usr/scala-v2.10.1-149-ged45b71
error: error while loading attr, class file 'sandbox/android.jar(android/R$attr.class)' has location not matching its contents: contains class android.
one error found

% RUNNER=scalac scala-hash v2.10.2-RC1~76 -classpath sandbox/android.jar sandbox/android.scala
[info] v2.10.2-RC => /Users/jason/usr/scala-v2.10.1-147-gc5ad8b4

% jar tf sandbox/android.jar | grep attr
android/R$attr.class

% javap -classpath android.jar 'android/R$attr' | head
Compiled from "R.java"
public final class android.R$attr extends java.lang.Object{
    public static final int absListViewStyle;
    public static final int accessibilityEventTypes;
    public static final int accessibilityFeedbackType;
    public static final int accessibilityFlags;
    public static final int accountPreferences;
    public static final int accountType;
    public static final int action;
    public static final int actionBarDivider;
@scabug
Copy link
Author

scabug commented May 30, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7532?orig=1
Reporter: @retronym
Affected Versions: 2.10.2-RC1
See #7251

@scabug
Copy link
Author

scabug commented May 30, 2013

@retronym said:
Oh, that was easier and more amusing than expected.

  private def currentIsTopLevel = {
    val r1 = !(currentClass.decodedName containsChar '$')
    val r2 = currentClass.toString.indexOf('$') < 0
    if (r1 != r2)
      println((r1, r2, currentClass.decodedName, currentClass.toString))
    r2
  }
(true,false,android.R@tr,android.R$attr)
(true,false,android.R@tr,android.R$attr)

I'll try to craft a test case for this and submit a PR shortly.

@scabug
Copy link
Author

scabug commented May 30, 2013

@retronym said:
scala/scala#2608

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

No branches or pull requests

2 participants