ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

Can't have Set of Classes on the rhs #366

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This code doesn't compile (Cannot find constructor of java.lang.Integer)

@Typed def foo() { 
  def a = [Integer] as Set
}

A workaround which works is

@Typed def foo() { 
  def tmp = [Integer]
  def a = tmp as Set
}

Original issue reported on code.google.com by adam%sch...@gtempaccount.com on 6 Apr 2011 at 4:53

GoogleCodeExporter commented 8 years ago
Does Set a = [Integer] works?

Original comment by alex.tka...@gmail.com on 6 Apr 2011 at 5:05

GoogleCodeExporter commented 8 years ago
No, there are actually more issues related to sets, but I can't see a common 
pattern yet.  Your suggestion doesn't work, but for another reason, see 
http://code.google.com/p/groovypptest/issues/detail?id=367

Original comment by adam%sch...@gtempaccount.com on 12 Apr 2011 at 7:03

GoogleCodeExporter commented 8 years ago
The same issue can also be reproduced through:
=======================
@Typed def foo() { 
    Object a = Integer
}
=======================

Fail with: "Cannot find constructor of java.lang.Integer"

See: http://gppconsole.appspot.com/script/25001

Original comment by roshanda...@gmail.com on 5 May 2011 at 7:53

GoogleCodeExporter commented 8 years ago
Created a separate issue for "Object a = Integer" compilation faiulre 
(http://code.google.com/p/groovypptest/issues/detail?id=372) and submitted a 
patch.

Original comment by roshanda...@gmail.com on 5 May 2011 at 10:13

GoogleCodeExporter commented 8 years ago

Original comment by alex.tka...@gmail.com on 5 May 2011 at 2:05