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

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

Issue 640813004: Handle non-factory redirects in constant evaluation. (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 library engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'package:analyzer/src/generated/java_core.dart'; 8 import 'package:analyzer/src/generated/java_core.dart';
9 import 'package:analyzer/src/generated/java_junit.dart'; 9 import 'package:analyzer/src/generated/java_junit.dart';
10 import 'package:analyzer/src/generated/java_engine.dart'; 10 import 'package:analyzer/src/generated/java_engine.dart';
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 835
836 void test_mapValueTypeNotAssignable() { 836 void test_mapValueTypeNotAssignable() {
837 Source source = addSource(EngineTestCase.createSource(["var v = const <Strin g, String> {'a' : 2};"])); 837 Source source = addSource(EngineTestCase.createSource(["var v = const <Strin g, String> {'a' : 2};"]));
838 resolve(source); 838 resolve(source);
839 assertErrors(source, [ 839 assertErrors(source, [
840 CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 840 CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE,
841 StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE]); 841 StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE]);
842 verify([source]); 842 verify([source]);
843 } 843 }
844 844
845 void test_redirectingConstructor_paramTypeMismatch() {
846 Source source = addSource(EngineTestCase.createSource([
847 "class A {",
848 " const A.a1(x) : this.a2(x);",
849 " const A.a2(String x);",
850 "}",
851 "var v = const A.a1(0);"]));
852 resolve(source);
853 assertErrors(source, [
854 CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH]);
855 verify([source]);
856 }
857
845 void test_parameterAssignable_null() { 858 void test_parameterAssignable_null() {
846 // Null is assignable to anything. 859 // Null is assignable to anything.
847 Source source = addSource(EngineTestCase.createSource([ 860 Source source = addSource(EngineTestCase.createSource([
848 "class A {", 861 "class A {",
849 " const A(int x);", 862 " const A(int x);",
850 "}", 863 "}",
851 "var v = const A(null);"])); 864 "var v = const A(null);"]));
852 resolve(source); 865 resolve(source);
853 assertNoErrors(source); 866 assertNoErrors(source);
854 verify([source]); 867 verify([source]);
(...skipping 10183 matching lines...) Expand 10 before | Expand all | Expand 10 after
11038 runReflectiveTests(TypeResolverVisitorTest); 11051 runReflectiveTests(TypeResolverVisitorTest);
11039 runReflectiveTests(CheckedModeCompileTimeErrorCodeTest); 11052 runReflectiveTests(CheckedModeCompileTimeErrorCodeTest);
11040 runReflectiveTests(ErrorResolverTest); 11053 runReflectiveTests(ErrorResolverTest);
11041 runReflectiveTests(HintCodeTest); 11054 runReflectiveTests(HintCodeTest);
11042 runReflectiveTests(MemberMapTest); 11055 runReflectiveTests(MemberMapTest);
11043 runReflectiveTests(NonHintCodeTest); 11056 runReflectiveTests(NonHintCodeTest);
11044 runReflectiveTests(SimpleResolverTest); 11057 runReflectiveTests(SimpleResolverTest);
11045 runReflectiveTests(StrictModeTest); 11058 runReflectiveTests(StrictModeTest);
11046 runReflectiveTests(TypePropagationTest); 11059 runReflectiveTests(TypePropagationTest);
11047 } 11060 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest.dart ('k') | tests/language/compile_time_constant_checked4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698