langtools/test/tools/javac/generics/6946618/T6946618b.java
author mcimadamore
Wed, 19 May 2010 16:42:37 +0100
changeset 5649 c9e7ce44b173
permissions -rw-r--r--
6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms. Summary: Bad cast to ClassType in the new diamond implementation fails if the target type of the instance creation expression is a type-variable Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5649
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     1
/*
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     3
 * @bug     6946618
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     4
 * @summary sqe test fails: javac/generics/NewOnTypeParm  in pit jdk7 b91 in all platforms.
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     5
 * @author  mcimadamore
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=T6946618b.out -XDrawDiagnostics T6946618b.java
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     7
 */
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     8
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
     9
class T6946618b {
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    10
    static class C<T> {
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    11
      T makeT() {
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    12
        return new T<>(); //error
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    13
      }
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    14
    }
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    15
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    16
    static class D<S> {
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    17
      C<S> makeC() {
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    18
        return new C<>(); //ok
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    19
      }
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    20
    }
c9e7ce44b173 6946618: sqe test fails: javac/generics/NewOnTypeParm in pit jdk7 b91 in all platforms.
mcimadamore
parents:
diff changeset
    21
}