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

Side by Side Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 652833002: Fix constant evaluation in the presence of nonexistent fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.resolver_test; 8 library engine.resolver_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2720 " break;", 2720 " break;",
2721 " }", 2721 " }",
2722 "}"])); 2722 "}"]));
2723 resolve(source); 2723 resolve(source);
2724 assertErrors(source, [ 2724 assertErrors(source, [
2725 CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, 2725 CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES,
2726 CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]); 2726 CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES]);
2727 verify([source]); 2727 verify([source]);
2728 } 2728 }
2729 2729
2730 void test_initializerForNonExistent_const() {
2731 // Check that the absence of a matching field doesn't cause a
2732 // crash during constant evaluation.
2733 Source source = addSource(EngineTestCase.createSource([
2734 "class A {",
2735 " const A() : x = 'foo';",
2736 "}",
2737 "A a = const A();"]));
2738 resolve(source);
2739 assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIEL D]);
2740 }
2741
2730 void test_initializerForNonExistant_initializer() { 2742 void test_initializerForNonExistant_initializer() {
2731 Source source = addSource(EngineTestCase.createSource(["class A {", " A() : x = 0 {}", "}"])); 2743 Source source = addSource(EngineTestCase.createSource(["class A {", " A() : x = 0 {}", "}"]));
2732 resolve(source); 2744 resolve(source);
2733 assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIEL D]); 2745 assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIEL D]);
2734 } 2746 }
2735 2747
2736 void test_initializerForStaticField() { 2748 void test_initializerForStaticField() {
2737 Source source = addSource(EngineTestCase.createSource(["class A {", " stati c int x;", " A() : x = 0 {}", "}"])); 2749 Source source = addSource(EngineTestCase.createSource(["class A {", " stati c int x;", " A() : x = 0 {}", "}"]));
2738 resolve(source); 2750 resolve(source);
2739 assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD]); 2751 assertErrors(source, [CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD]);
(...skipping 20646 matching lines...) Expand 10 before | Expand all | Expand 10 after
23386 runReflectiveTests(HintCodeTest); 23398 runReflectiveTests(HintCodeTest);
23387 runReflectiveTests(MemberMapTest); 23399 runReflectiveTests(MemberMapTest);
23388 runReflectiveTests(NonErrorResolverTest); 23400 runReflectiveTests(NonErrorResolverTest);
23389 runReflectiveTests(NonHintCodeTest); 23401 runReflectiveTests(NonHintCodeTest);
23390 runReflectiveTests(SimpleResolverTest); 23402 runReflectiveTests(SimpleResolverTest);
23391 runReflectiveTests(StaticTypeWarningCodeTest); 23403 runReflectiveTests(StaticTypeWarningCodeTest);
23392 runReflectiveTests(StaticWarningCodeTest); 23404 runReflectiveTests(StaticWarningCodeTest);
23393 runReflectiveTests(StrictModeTest); 23405 runReflectiveTests(StrictModeTest);
23394 runReflectiveTests(TypePropagationTest); 23406 runReflectiveTests(TypePropagationTest);
23395 } 23407 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698