|
weirdness in typechecking call on overloaded java method: msg#00099lang.scala
Hi, I've stumbled upon a typing issue I'm at a loss to explain. Following is a minimal test case: --------------------------------------------- // ScalaMenuTest.scala object ScalaMenuTest { def main(args: Array[String]): Unit = { val v = new javax.swing.JMenu() v.add(new javax.swing.JMenuItem()) //v.add(new java.awt.PopupMenu()); } } //==> compiling with scalac2 results in // // found : javax.swing.JMenuItem // required: java.awt.PopupMenu // v.add(new javax.swing.JMenuItem()) // ^ //one error found --------------------------------------------- As a sanity check, here is the equivalent Java code: --------------------------------------------- // JavaMenuTest.java class JavaMenuTest { public static void main(String[] args) { javax.swing.JMenu v = new javax.swing.JMenu(); v.add(new javax.swing.JMenuItem()); //v.add(new java.awt.PopupMenu()); } } --------------------------------------------- I'd greatly appreciate if someone could verify; perhaps it's a environment-related issue on my end?? If not, is it perhaps a compiler bug? What I find truly bizarre is that if the call adding a PopupMenu is uncommented, it then typechecks just fine. Many thanks, Jason |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: gadt: 00099, Martin Odersky |
|---|---|
| Next by Date: | Re: weirdness in typechecking call on overloaded java method: 00099, Lex Spoon |
| Previous by Thread: | gadti: 00099, Niels Hoogeveen |
| Next by Thread: | Re: weirdness in typechecking call on overloaded java method: 00099, Lex Spoon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |