BaseLanguage Generics

I was playing with generics in BaseLanguage and I'm wondering why no typechecking for this case is present:


In the generation I see, that the 3 cases with char, int and float are not allowed with Double Generic. The other 2 are error highlighted. Are these checks just missing, should I do them myself?

Comment actions Permalink
A bit late but here is an attempt to answer this:

stack.push(1.1) -> Float extends Double
stack.push(1) -> Int extends Long -> Long extends Float
stack.push(1.1f) -> Float extends Double
stack.push('A') -> Char extends Int

Each of this types can be implicit converted into each other except the ArrayType and the StringType.
Comment actions Permalink
Yeah I'm aware of that, still it would be nice to have a warning that these types need to be casted. Till now you only notice the problem when generating the code. But thanks, it's probably designed this way.

Please sign in to leave a comment.