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:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to