cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 158 forks source link

Copy constructor for ArrayList does not work #539

Closed Icare67 closed 5 years ago

Icare67 commented 5 years ago

In the following example , I expect a2 to be a copy of al. But it creates an array of array.

public static void test()
    {
            ArrayList<String> al = new ArrayList<String>();
        al.add("foo");
        al.add("bar");
        ArrayList<String> a2 = new ArrayList<String>(al);
        assert al.size() == a2.size();
    }
lgrignon commented 5 years ago

Thanks @Icare67 for reporting those bugs. Would you have time to contribute a bit? I will try to fix as much as possible on my side

lgrignon commented 5 years ago

Sorry, but I cannot reproduce your problem. Please see https://github.com/cincheo/jsweet/commit/7fd8496dc357f0c273f8f35c55b7335b4451f351

Which version of JSweet are you using?

lgrignon commented 5 years ago

Please reopen if problem still occurs with last version of JSweet

Icare67 commented 5 years ago

I'm using " JSweet transpiler version 2.3.0-SNAPSHOT (build date: 2019-05-01 10:19:57)"