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

Assertion failed when accessing scala.swing.Key enumeration #1849

Closed
scabug opened this issue Apr 2, 2009 · 4 comments
Closed

Assertion failed when accessing scala.swing.Key enumeration #1849

scabug opened this issue Apr 2, 2009 · 4 comments
Assignees

Comments

@scabug
Copy link

scabug commented Apr 2, 2009

The following error occurs when attempting to access a value in the scala.swing.Key enumeration:

scala> val x = scala.swing.Key.F
java.lang.AssertionError: assertion failed
        at scala.Predef$$.assert(Predef.scala:87)
        at scala.Enumeration$$Val.<init>(Enumeration.scala:220)
        at scala.Enumeration.Value(Enumeration.scala:160)
        at scala.swing.Key$$.<init>(Key.scala:84)
        at scala.swing.Key$$.<clinit>(Key.scala)
        at .<init>(<console>:4)
        at .<clinit>(<console>)
        at RequestResult$$.<init>(<console>:3)
        at RequestResult$$.<cli...

I believe the problem is that two of the values in the enumeration has the same ordinal:

val Separater = Value(VK_SEPARATER)
val Separator = Value(VK_SEPARATOR)

VK_SEPARATOR is defined in java.awt.event.KeyEvent as:

public static final int VK_SEPARATOR = VK_SEPARATER;

Probably the easiest solution is to just remove the Separater value since it's only included in KeyEvent for backwards compatibility, which is most likely not a concern for the scala.swing API yet.

@scabug
Copy link
Author

scabug commented Apr 2, 2009

Imported From: https://issues.scala-lang.org/browse/SI-1849?orig=1
Reporter: Gordon Tyler (gtyler)

@scabug
Copy link
Author

scabug commented Jun 24, 2009

@ingoem said:
Oh, I missed this one. Has been fixed in trunk.

@scabug
Copy link
Author

scabug commented Nov 3, 2009

@DavidBiesack said:
This still exists in 2.7.7RC2
There is a (I believe) trivial fix for that there (remove the mnemonic for the deprecated VK_SEPARATER)

Without this change in the 2.7 codebase, mnemonics cannot be used at all in 2.7.7.

@scabug
Copy link
Author

scabug commented Mar 28, 2010

@ingoem said:
I am closing this now. It's fixed in trunk and I don't think there will be another 2.7 release.

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

No branches or pull requests

2 participants