On Sun, 2012-07-22 at 16:41 -0300, Ricky Clarkson wrote: > Let me know when int i = "hello"; is rejected by the compiler and I'll look > again.
On the other hand, Groovy has taken a foray into static typing:
import groovy.transform.TypeChecked
@TypeChecked
def f ( ) {
int i = 'Hello'
}
leads to a compiler error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
/home/users/russel/Progs/OddsByLanguage/Groovy/staticTyping.groovy: 5:
[Static type checking] - Cannot assign value of type java.lang.String to
variable of type int
@ line 5, column 11.
int i = 'Hello'
^
1 error
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
