Diamond - no method matches

Issue #173 open
Jörg Hagemann created an issue

This example causes an error:

Diamond.java:6: error: no method named addAll(java.util.ArrayList<java.lang.Object>) in java.util.Set<java.lang.String> matches. However, there is a method addAll(java.util.Collection<wildcards.? extends java.lang.String>)

import java.util.*;
public class Diamond {
    public static void main(String[] args) {
        Set<String> hashSet01 = new HashSet<>();
        Set<String> hashSet02 = new HashSet<>();
        hashSet02.addAll(new ArrayList<>(hashSet01));   // new ArrayList<String>(hashSet01) works
    }
}

Comments (3)

  1. Jesper Öqvist
    • changed status to resolved
    • edited description

    This test passes with ExtendJ 8.0.1-168-gef13696 Java SE 8.

    Thank you for the test case, I have added it to the regression test suite.

  2. Log in to comment