langtools/test/tools/javac/annotations/typeAnnotations/failures/T8020715.java
author jjg
Wed, 21 Aug 2013 16:13:50 -0700
changeset 19651 b1aa46cc2198
permissions -rw-r--r--
8023515: import type-annotations updates Reviewed-by: jjg Contributed-by: wdietl@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19651
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     1
/*
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     4
 *
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     8
 *
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    13
 * accompanied this code).
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    14
 *
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    18
 *
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    21
 * questions.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    22
 */
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    23
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    24
/*
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    25
 * @test
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    26
 * @summary Regression: compiling program with lambda crashed compiler
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    27
 * @bug 8020715
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    28
 * @compile T8020715.java
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    29
 */
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    30
class T8020715 {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    31
    // This crashed.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    32
    private static  void  makeTask1() {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    33
        class LocalClass {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    34
            private Runnable r = () -> {};
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    35
        }
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    36
    }
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    37
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    38
    // This crashed, too.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    39
    private  void  makeTask2() {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    40
        class LocalClass {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    41
            private Runnable r = () -> {};
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    42
        }
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    43
    }
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    44
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    45
    // This is fine.
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    46
    private class InnerClass {
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    47
        private Runnable r = () -> {};
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    48
    }
b1aa46cc2198 8023515: import type-annotations updates
jjg
parents:
diff changeset
    49
}