test/tools/javac/diags/examples/InvalidInferredTypes.java

changeset 1251
6f0ed5a89c25
parent 1238
e28a06a3c5d9
     1.1 --- a/test/tools/javac/diags/examples/InvalidInferredTypes.java	Tue Apr 10 23:19:26 2012 -0700
     1.2 +++ b/test/tools/javac/diags/examples/InvalidInferredTypes.java	Wed Apr 11 10:50:11 2012 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -23,17 +23,15 @@
    1.11  
    1.12  // key: compiler.err.prob.found.req.1
    1.13  // key: compiler.misc.invalid.inferred.types
    1.14 -// key: compiler.misc.inferred.do.not.conform.to.bounds
    1.15 +// key: compiler.misc.inferred.do.not.conform.to.upper.bounds
    1.16  
    1.17  import java.util.*;
    1.18  
    1.19  class InvalidInferredTypes {
    1.20  
    1.21 -    <T extends List<? super T>> T makeList() {
    1.22 -        return null;
    1.23 -    }
    1.24 +    <S extends String> List<S> m() { return null; }
    1.25  
    1.26 -    public void test() {
    1.27 -        List<? super String> l = makeList();
    1.28 +    void test() {
    1.29 +        List<Integer> li = m();
    1.30      }
    1.31  }

mercurial