| Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| index ba49389744712ae7140f92c98472e09b719b7e26..cba5892d4dbcdcf5cdfad2494c178405a81e587a 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -1721,6 +1721,20 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| assertErrors(result.getErrors(), errEx(TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE, 4, 22, 1));
|
| }
|
|
|
| + public void test_typeVariableBoundsCheckNew() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "class Object {}",
|
| + "class A { }",
|
| + "class B { }",
|
| + "class C<T extends A> { }",
|
| + "method() {",
|
| + " new C<B>();", // B not assignable to A
|
| + "}");
|
| + assertErrors(
|
| + libraryResult.getErrors(),
|
| + errEx(TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE, 6, 9, 1));
|
| + }
|
| +
|
| /**
|
| * When we check getter/setter compatibility, we should compare propagated type variables.
|
| * <p>
|
| @@ -3166,6 +3180,17 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| errEx(TypeErrorCode.OVERRIDING_STATIC_MEMBER, 8, 3, 3));
|
| }
|
|
|
| + public void test_rethrowNotInCatch() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "class Object {}",
|
| + "method() {",
|
| + " throw;",
|
| + "}");
|
| + assertErrors(
|
| + libraryResult.getErrors(),
|
| + errEx(ResolverErrorCode.RETHROW_NOT_IN_CATCH, 3, 3, 6));
|
| + }
|
| +
|
| private static <T extends DartNode> T findNode(
|
| AnalyzeLibraryResult libraryResult,
|
| final Class<T> clazz,
|
|
|