Surprising behavior casting BigInteger to int/long for constructor call

Sean Gilligan <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <[email protected]>
When I try the following code (on either Groovy 3.0.9 or Groovy 4.0.0-rc-2)

class I {
     long v;

     I(int i) {
         v = i;
     }
}

class L {
     long v;

     L(long l) {
         v = l;
     }
}

def a = new I(1G)
def b = new L(1G)

I get `Could not find matching constructor for: L(BigInteger)` when 
trying to construct an `L`.  The `I` is constructed without error.

Am I missing something or is this a bug?

-- Sean
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.