langtools/test/tools/javac/lambda/NestedCapture01.java
author vromero
Mon, 02 Sep 2013 22:38:36 +0100
changeset 19914 d86271bd430a
parent 18911 dcc1e26a8c9c
permissions -rw-r--r--
8016177: structural most specific and stuckness Reviewed-by: jjg, vromero Contributed-by: maurizio.cimadamore@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18911
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     1
/*
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     4
 *
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     7
 * published by the Free Software Foundation.
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     8
 *
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    13
 * accompanied this code).
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    14
 *
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    18
 *
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    21
 * questions.
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    22
 */
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    23
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    24
/*
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    25
 * @test
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    26
 * @bug 8012238
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    27
 * @summary Nested method capture and inference
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    28
 * @compile NestedCapture01.java
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    29
 */
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    30
class NestedCapture01 {
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    31
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    32
    void test(String s) {
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    33
       g(m(s.getClass()));
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    34
    }
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    35
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    36
    <F extends String> F m(Class<F> cf) {
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    37
       return null;
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    38
    }
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    39
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    40
    <P extends String> P g(P vo) {
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    41
       return null;
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    42
    }
dcc1e26a8c9c 8012238: Nested method capture and inference
mcimadamore
parents:
diff changeset
    43
}