Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 571523002: Issue 20894. Rename 'Class' when rename refactoring is activated on 'Class' in 'new Class.name()'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 2735d72e9fd31470b2cc99b39b986f2c0eec223a..329766df9c0ac61f45295b9f0c8131993d7d1490 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -16331,6 +16331,52 @@ class NonErrorResolverTest extends ResolverTestCase {
}
class NonHintCodeTest extends ResolverTestCase {
+ void fail_issue20904BuggyTypePromotionAtIfJoin_1() {
+ // https://code.google.com/p/dart/issues/detail?id=20904
+ Source source = addSource(EngineTestCase.createSource([
+ "f(var message, var dynamic_) {",
+ " if (message is Function) {",
+ " message = dynamic_;",
+ " }",
+ " int s = message;",
+ "}",
+ ""]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void fail_issue20904BuggyTypePromotionAtIfJoin_2() {
+ // https://code.google.com/p/dart/issues/detail?id=20904
+ Source source = addSource(EngineTestCase.createSource([
+ "f(var message) {",
+ " if (message is Function) {",
+ " message = '';",
+ " }",
+ " int s = message;",
+ "}"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ void fail_issue20904BuggyTypePromotionAtIfJoin_3() {
+ // https://code.google.com/p/dart/issues/detail?id=20904
+ Source source = addSource(EngineTestCase.createSource([
+ "f(var message) {",
+ " var dynamic_;",
+ " if (message is Function) {",
+ " message = dynamic_;",
+ " } else {",
+ " return;",
+ " }",
+ " int s = message;",
+ "}"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_deadCode_deadBlock_conditionalElse_debugConst() {
Source source = addSource(EngineTestCase.createSource([
"const bool DEBUG = true;",
@@ -16542,6 +16588,22 @@ class NonHintCodeTest extends ResolverTestCase {
"main() { lib1.f(); }"])], <ErrorCode> [ParserErrorCode.DEFERRED_IMPORTS_NOT_SUPPORTED], <ErrorCode> []);
}
+ void test_issue20904BuggyTypePromotionAtIfJoin_4() {
+ // https://code.google.com/p/dart/issues/detail?id=20904
+ Source source = addSource(EngineTestCase.createSource([
+ "f(var message) {",
+ " if (message is Function) {",
+ " message = '';",
+ " } else {",
+ " return;",
+ " }",
+ " String s = message;",
+ "}"]));
+ resolve(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
void test_missingReturn_emptyFunctionBody() {
Source source = addSource(EngineTestCase.createSource(["abstract class A {", " int m();", "}"]));
resolve(source);
@@ -17133,6 +17195,10 @@ class NonHintCodeTest extends ResolverTestCase {
final __test = new NonHintCodeTest();
runJUnitTest(__test, __test.test_importDeferredLibraryWithLoadFunction);
});
+ _ut.test('test_issue20904BuggyTypePromotionAtIfJoin_4', () {
+ final __test = new NonHintCodeTest();
+ runJUnitTest(__test, __test.test_issue20904BuggyTypePromotionAtIfJoin_4);
+ });
_ut.test('test_missingReturn_emptyFunctionBody', () {
final __test = new NonHintCodeTest();
runJUnitTest(__test, __test.test_missingReturn_emptyFunctionBody);
@@ -27358,6 +27424,20 @@ class TypeOverrideManagerTest extends EngineTestCase {
}
class TypePropagationTest extends ResolverTestCase {
+ void fail_issue20904BuggyTypePromotionAtIfJoin_2() {
+ // https://code.google.com/p/dart/issues/detail?id=20904
+ String code = EngineTestCase.createSource([
+ "f(var message) {",
+ " if (message is Function) {",
+ " message = '';",
+ " }",
+ " message; // marker",
+ "}"]);
+ DartType t = _findMarkedIdentifier(code, "; // marker").propagatedType;
+ JUnitTestCase.assertFalse(typeProvider.stringType == t);
+ JUnitTestCase.assertFalse(typeProvider.functionType == t);
+ }
+
void fail_mergePropagatedTypesAtJoinPoint_1() {
// https://code.google.com/p/dart/issues/detail?id=19929
_assertTypeOfMarkedExpression(EngineTestCase.createSource([
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698