blob: 8acc3b2b12c3e9c910137c779eb791aaf65315bb [file] [log] [blame]
import java.util.HashMap;
import java.util.Map;
import org.checkerframework.checker.nullness.qual.*;
// test related to issue 429: https://github.com/typetools/checker-framework/issues/429
public class KeyForPolymorphism {
Map<String, Object> m1 = new HashMap<>();
Map<String, Object> m2 = new HashMap<>();
void method(@KeyFor("m1") String k1m1, @KeyFor("m2") String k1m2) {
@KeyFor("m1") String k2m1 = identity1(k1m1);
@KeyFor("m2") String k2m2 = identity1(k1m2);
}
static @PolyKeyFor String identity1(@PolyKeyFor String arg) {
return arg;
}
}