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

Cannot extend JavaFX class DatePickerSkin #11584

Open
countfloyd opened this issue Jun 24, 2019 · 10 comments

Comments

Projects
None yet
5 participants
@countfloyd
Copy link

commented Jun 24, 2019

Attaching a tar file of sample project. Simple run 'sbt compile' to see the error. I don't see any workaround for this problem.

Code works in 2.12.8 but not 2.13.0

bug.zip

Error is:

[error] /Users/curtis/guild1/code/bug/src/main/scala/Bug.scala:4:7: incompatible type in overriding
[error] private[package skin] def getBehavior(): com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior[_] (defined in class ComboBoxBaseSkin)
[error]   with private[package skin] def getBehavior(): com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior (defined in class DatePickerSkin);
[error]  found   : ()com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior
[error]  required: ()com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior[_]
[error] class Bug(ymPicker: DatePicker) extends DatePickerSkin(ymPicker) {
[error]       ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Two raw types were walking down the street. One was cooked, the other wasn't?

[nix-shell:~]$ export CP=/home/haro/.ivy2/cache/org.openjfx/javafx-base/jars/javafx-base-12.0.1-linux.jar:/home/haro/.ivy2/cache/org.openjfx/javafx-graphics/jars/javafx-graphics-12.0.1-linux.jar:/home/haro/.ivy2/cache/org.openjfx/javafx-controls/jars/javafx-controls-12.0.1-linux.jar:/home/haro/.ivy2/cache/org.openjfx/javafx-fxml/jars/javafx-fxml-12.0.1-linux.jar

[nix-shell:~]$ javap -cp $CP -s javafx.scene.control.skin.DatePickerSkin | grep -C 1 getBehavior

  com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior getBehavior();
    descriptor: ()Lcom/sun/javafx/scene/control/behavior/ComboBoxBaseBehavior;

[nix-shell:~]$ javap -cp $CP -s javafx.scene.control.skin.ComboBoxBaseSkin | grep -C 1 getBehavior

  com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior getBehavior();
    descriptor: ()Lcom/sun/javafx/scene/control/behavior/ComboBoxBaseBehavior;

[nix-shell:~]$ javap -cp $CP -s com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior | grep behavior\.ComboBoxBaseBehavior
public class com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior<T> extends com.sun.javafx.scene.control.behavior.BehaviorBase<javafx.scene.control.ComboBoxBase<T>> {
  public com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior(javafx.scene.control.ComboBoxBase<T>);

EDIT: unsurprisingly, the real error message is:

[error] /tmp/tmp.IsuD8590R9/bug/src/main/scala/Bug.scala:4:7: incompatible type in overriding
[error] <method> <java> <triedcooking> private[package class skin] def getBehavior(): behavior.this.ComboBoxBaseBehavior[T] forSome { type T } (defined in class ComboBoxBaseSkin)
[error]   with <method> <java> private[package class skin] def getBehavior(): behavior.this.ComboBoxBaseBehavior (defined in class DatePickerSkin);
[error]  found   : ()behavior.this.ComboBoxBaseBehavior
[error]  required: ()behavior.this.ComboBoxBaseBehavior[T] forSome { type T }
[error] class Bug(ymPicker: DatePicker) extends DatePickerSkin(ymPicker) {
[error]       ^

@hrhino hrhino added the regression label Jun 24, 2019

@hrhino hrhino added this to the 2.13.1 milestone Jun 25, 2019

@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

I'm tentatively assigning this to 2.13.1 simply because I also cannot think of a workaround, and while javafx is pretty horrid code, this seems like the sort of thing someone else would do, too.

@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

A minimization:

==> test/files/pos/t11584/Fiddle_1.java <==
package t11584;

public class Fiddle_1 {
    public Misbehavior_1 misbehave() { throw new Error(); }
}
==> test/files/pos/t11584/Misbehavior_1.java <==
package t11584;

public interface Misbehavior_1<T> {}
==> test/files/pos/t11584/Riddle_1.java <==
package t11584;

public class Riddle_1 extends Fiddle_1 {
    @Override public Misbehavior_1 misbehave() { throw new Error(); }
}
==> test/files/pos/t11584/Why_2.scala <==
import t11584._

class Why extends Riddle_1
@OlegYch

This comment has been minimized.

Copy link

commented Jun 28, 2019

fwiw getting same error with CUP generated parsers

@hrhino hrhino self-assigned this Jun 28, 2019

@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

fwiw this looks like a decent weekend project; I'll have a look.

@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 28, 2019

@OlegYch if you attach a small example of whatever a "CUP generated parser" looks like I'll use it as a test case as well, if it doesn't rely on some other library.

@OlegYch

This comment has been minimized.

Copy link

commented Jun 28, 2019

it looks just like your minimization, except it uses java.lang.Class instead of Misbehavior_1

@hrhino

This comment has been minimized.

Copy link
Member

commented Jun 29, 2019

NTS: culprit is apparently scala/scala@fde215f.

@NthPortal

This comment has been minimized.

Copy link

commented Jul 1, 2019

cc @adriaanm

@SethTisue

This comment has been minimized.

Copy link
Member

commented Jul 3, 2019

#11588 has another example

@SethTisue SethTisue added the blocker label Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.