Tuple with Java class throws ClassCastException #5243
Comments
[@FroMage] Yes, apparently we forgot to deal with Java types in there, sorry. |
[@renatoathaydes] I think I found another Java interop issue but may be closely related to this issue: Here's 2 Java classes: public class X<B> {}
public class Y {
public String hi(X<Boolean> b) {
return b.toString();
}
} Now, in Ceylon, I want to do this: value x = X<Boolean>();
value y = Y();
y.hi(x); This results in an error:
I believe the Ceylon Boolean should have been mapped to Java's Boolean?! |
[@gavinking]
No, that doesn't (and can't) happen with generic types. Sorry. |
[@ncorai] I get the same error when passing a Java type to a curried first-class function:
The function invoked at |
[@ncorai] And here's another one courtesy of the SDK:
If you guys release 1.0.1, any chance a fix for this issue could make it? |
[@lucaswerkmeister] This was fixed in 8171fd8 and 23dc1ed, wasn’t it? At least Renato’s example works for me now… |
[@FroMage] Then we just need a test to close this. |
[@tombentley] Added a test. Closing. |
…t really compiler tests, but are JVM only.
[@renatoathaydes] This problem seems to only occur when using Java classes in the tuple.
Here's an example:
When trying to compute y, this Exception is thrown:
I used a comprehension in the example above, but using
map
, for example, also results in the same error.If we use an Iterable such as in:
Then, no error occurs.
Question originally posted on StackOverflow with another example:
stackoverflow.com/questions/20226520/ceylon-cannot-apply-some-functions-to-tuples
[Migrated from ceylon/ceylon.language#365]
[Closed at 2014-03-24 14:47:42]
The text was updated successfully, but these errors were encountered: