Skip to content

Java protected members overriding from Scala #1469

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

Closed
scabug opened this issue Oct 30, 2008 · 3 comments
Closed

Java protected members overriding from Scala #1469

scabug opened this issue Oct 30, 2008 · 3 comments
Milestone

Comments

@scabug
Copy link

scabug commented Oct 30, 2008

Java class

 package aaa;

 public abstract class MyJavaClass {
     abstract protected int foo();
 }

Scala class

 package ccc

 import aaa.MyJavaClass

 class MyScalaClass extends MyJavaClass {
     protected def foo: Int = 42
 }

We cannot compile them together cause and get a compilation error
"Error:Error:line (6)error: error overriding method foo in class MyJavaClass
of type ()scala.this.Int;
method foo has weaker access privileges; it should be at least
protected[aaa]
protected def foo: Int = 42"

But if MyJavaClass is already compiled and added to appropriate classpath we can compile our MyScalaClass without any problems.

@scabug
Copy link
Author

scabug commented Oct 30, 2008

Imported From: https://issues.scala-lang.org/browse/SI-1469?orig=1
Reporter: @ilyasergey

@scabug scabug added this to the Backlog milestone Apr 6, 2017
@SethTisue SethTisue changed the title Java protected members overrinding from Scala Java protected members overriding from Scala Feb 17, 2018
@scala scala deleted a comment from scabug Feb 17, 2018
@scala scala deleted a comment from scabug Feb 17, 2018
@scala scala deleted a comment from scabug Feb 17, 2018
@scala scala deleted a comment from scabug Feb 17, 2018
@magnolia-k
Copy link

In recent Scala (at least 2.13, 2.12, 2.11), this code can be compiled.

@NthPortal
Copy link

thanks for verifying!

@SethTisue SethTisue modified the milestones: Backlog, 2.11.12 Aug 12, 2019
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