groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keegan Witt <keeganw...@gmail.com>
Subject Documenting primitive autoboxing
Date Thu, 20 Aug 2015 13:34:33 GMT
So I didn't see anywhere that we documented that Groovy autoboxes primitive
types, like this

byte by
short s
int i
long l
float f
double d
char c
boolean bo

assert by.class != byte.class && by.class == Byte.class
assert s.class != short.class && s.class == Short.class
assert i.class != int.class && i.class == Integer.class
assert l.class != long.class && l.class == Long.class
assert f.class != float.class && f.class == Float.class
assert d.class != double.class && d.class == Double.class
assert c.class != char.class && c.class == Character.class
assert bo.class != boolean.class && bo.class == Boolean.class


If I've missed where we documented this, please point it out to me.  If I'm
right about it not being documented, where should it be added?  I was
thinking maybe in the"Primitive types" section in 1.4 of
core-object-orientation.adoc and maybe a new section in
core-differences-java.adoc as well.  What do you think?

-Keegan

Mime
View raw message