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

Do not choke on Java's default methods when parsing Java source files #7398

Closed
scabug opened this issue Apr 21, 2013 · 8 comments
Closed

Do not choke on Java's default methods when parsing Java source files #7398

scabug opened this issue Apr 21, 2013 · 8 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Apr 21, 2013

Consider the following Java interface that defines default method:

interface TestInterface{
  public void testMe();
   
  default public void aDefaulter() {
    System.out.println("Default from interface");
  }
}

and the following Scala code:

class TestImpl extends TestInterface {
	def testMe() { println("TestImpl.testMe") }
	/*override def aDefaulter() { { println("TestImpl.aDefaulter") } }*/
}

When we try to compile it by passing both source files, Scala's parser for java files chokes on default modifier:

scalac -d classes/ src/TestInterface.java src/TestImpl.scala
src/TestInterface.java:4: error: illegal start of type
  default public void aDefaulter() {
  ^
src/TestInterface.java:7: error: identifier expected but `}' found.
}
^
two errors found
@scabug
Copy link
Author

scabug commented Apr 21, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7398?orig=1
Reporter: @gkossakowski
Affected Versions: 2.10.1

@scabug
Copy link
Author

scabug commented Apr 26, 2013

@paulp said:
scala/scala#2455

@scabug
Copy link
Author

scabug commented Apr 26, 2013

@paulp said:
Heh, I just realized I forgot to even try compiling java source, since I was really focused on being able to build scala with java8. I have a good feeling though. I realize it is without tests.

@scabug
Copy link
Author

scabug commented Apr 26, 2013

@paulp said:
Nope, I failed the source parser. I guess one should try something out at least once before shipping it. I shall return.

@scabug
Copy link
Author

scabug commented Apr 26, 2013

@paulp said:
scala/scala#2456

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented May 20, 2013

@gkossakowski said:
James, Wasn't it fixed by scala/scala#2456 ?

@scabug scabug closed this as completed Aug 19, 2013
@scabug
Copy link
Author

scabug commented Aug 19, 2013

@paulp said:
b2c67b328d

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