langtools/test/tools/javac/diags/examples/InvalidInferredTypes.java
changeset 12468 1100643c0209
parent 12334 29e1bfdcba4e
equal deleted inserted replaced
12467:f0240b351279 12468:1100643c0209
     1 /*
     1 /*
     2  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 // key: compiler.err.prob.found.req.1
    24 // key: compiler.err.prob.found.req.1
    25 // key: compiler.misc.invalid.inferred.types
    25 // key: compiler.misc.invalid.inferred.types
    26 // key: compiler.misc.inferred.do.not.conform.to.bounds
    26 // key: compiler.misc.inferred.do.not.conform.to.upper.bounds
    27 
    27 
    28 import java.util.*;
    28 import java.util.*;
    29 
    29 
    30 class InvalidInferredTypes {
    30 class InvalidInferredTypes {
    31 
    31 
    32     <T extends List<? super T>> T makeList() {
    32     <S extends String> List<S> m() { return null; }
    33         return null;
       
    34     }
       
    35 
    33 
    36     public void test() {
    34     void test() {
    37         List<? super String> l = makeList();
    35         List<Integer> li = m();
    38     }
    36     }
    39 }
    37 }