author | hseigel |
Wed, 02 Mar 2016 23:48:41 +0000 | |
changeset 36397 | c487ced7231c |
parent 7627 | de2a86da165e |
permissions | -rw-r--r-- |
7627
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
1 |
/* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
2 |
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
4 |
* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
8 |
* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
13 |
* accompanied this code). |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
14 |
* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
18 |
* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
21 |
* questions. |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
22 |
*/ |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
23 |
|
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
24 |
/* |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
25 |
* @test |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
26 |
* @bug 7005095 |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
27 |
* @summary Cast: compile reject sensible cast from final class to interface |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
28 |
* @compile T7005095pos.java |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
29 |
*/ |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
30 |
|
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
31 |
class T7005095pos<T extends CharSequence> { |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
32 |
interface Foo<T> {} |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
33 |
|
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
34 |
static final class FooImpl implements Foo<String> {} |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
35 |
|
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
36 |
Object o = (Foo<T>) new FooImpl(); |
de2a86da165e
7005095: Cast: compile reject sensible cast from final class to interface
mcimadamore
parents:
diff
changeset
|
37 |
} |