RosettaCodeData/Task/Multiple-distinct-objects/Groovy/multiple-distinct-objects-2.groovy

3 lines
98 B
Groovy
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
// Following fails, creates n references to same object
def createFoos2 = {n -> [new Foo()] * n }