Page 1 of 1

Integer default?

PostPosted: Wed Jul 07, 2010 11:41 am
by _Gold_Fish
I know this is probably already somewhere, but I can't find it, so here goes.
What does int (e.g. when used as List<of int>() ) default to? Is it int32 or int64? Because I received this error earlier today:
Code: Select all
 error: Argument 1 of method "add" expects type int?, but the call is supplying type int64.

As a side note, Cobra dies when I put:
List<of int64>()

As another side note, when I use the "is" statement, it throws an error:
error: The left and right sides of the "is" expression can never be identical because of their types ("int64" and "Type"). Maybe you should try "inherits" instead of "is".

It seems to think that int32 and int64 are identical, is this purposeful on your part?

Re: Integer default?

PostPosted: Wed Jul 07, 2010 1:15 pm
by Charles
"int" defaults to "int32". "int64" is definitely a different type. When I create a list of them, it works for me:
class X

def main
t = List<of int64>()
trace t

Can you include code samples for these problems you have? The smaller the better. I'll be able to give you better help.

Re: Integer default?

PostPosted: Wed Jul 07, 2010 3:12 pm
by _Gold_Fish
Unfortunately, I deleted the code earlier and just thought I'd ask here.
Oh well, thanks for the clarification!