langtools/test/tools/javac/T8175790/NPEDueToErroneousLambdaTest.java
author vromero
Fri, 03 Mar 2017 09:58:11 -0800
changeset 44060 f420de7e26fa
permissions -rw-r--r--
8175790: field JCVariableDecl.vartype can't be null after post attribution analysis Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44060
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     1
/*
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     3
 * @bug 8175790
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     4
 * @summary field JCVariableDecl.vartype can't be null after post attribution analysis
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     5
 * @compile/fail/ref=NPEDueToErroneousLambdaTest.out -XDrawDiagnostics NPEDueToErroneousLambdaTest.java
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     6
 */
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     7
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     8
import java.util.List;
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
     9
import java.util.function.Function;
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    10
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    11
public abstract class NPEDueToErroneousLambdaTest {
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    12
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    13
    interface R {}
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    14
    interface A {}
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    15
    interface S {}
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    16
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    17
    abstract <I, O> Function<I, O> p(final Function<I, O> function);
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    18
    abstract <I, O> List<O> t(Function<? super I, ? extends O> function);
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    19
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    20
    public void f() {
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    21
        t(p(new Function<A, Object>() {
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    22
            public List<Object> apply(A a) throws Exception {
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    23
                return t((Function<R, S>)input -> {
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    24
                        return t(p((Function<Boolean, S>) i -> null), null);
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    25
                });
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    26
            }
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    27
        }));
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    28
    }
f420de7e26fa 8175790: field JCVariableDecl.vartype can't be null after post attribution analysis
vromero
parents:
diff changeset
    29
}