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

java classes not given necessary ThisType prefixes #7538

Open
scabug opened this issue May 30, 2013 · 4 comments
Open

java classes not given necessary ThisType prefixes #7538

scabug opened this issue May 30, 2013 · 4 comments

Comments

@scabug
Copy link

scabug commented May 30, 2013

Given classfiles built from these should-be-equivalent scala and java sources:

// scala
package s

class Foo[A] {
  abstract class Bar extends java.util.Iterator[A]
  abstract class SubBar extends Bar
}

// java
package j;

public class JFoo<A> {
  public abstract class Bar implements java.util.Iterator<A> { }
  public abstract class SubBar extends Bar { }
}

...we are given a malformed prefix for java's SubBar, and a correct one for scala's.

scala> (typeOf[s.Foo[_]] member TypeName("SubBar")).info.parents
res1: List[$r.intp.global.Type] = List(Foo.this.Bar)

scala> (typeOf[j.JFoo[_]] member TypeName("SubBar")).info.parents
res2: List[$r.intp.global.Type] = List(j.JFoo[A]#Bar)
@scabug
Copy link
Author

scabug commented May 30, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7538?orig=1
Reporter: @paulp
Attachments:

@scabug
Copy link
Author

scabug commented Aug 15, 2013

@paulp said:
Attached my patch in case it will save someone else some time.

@SethTisue
Copy link
Member

still reproducible in Scala 2? fixed in Scala 3? (anyone feel like checking?)

@joroKr21
Copy link
Member

I can reproduce it with $SubBar in Scala 2.13 - not sure how you would check in Scala 3

@SethTisue SethTisue added this to the Backlog milestone Apr 15, 2023
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

4 participants