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

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

Issue 940853002: Issue 22409. Restore recognizing string concatenation in const expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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.non_error_resolver_test; 5 library engine.non_error_resolver_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; 10 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 const B.c4(String p) : v = p != 0.0; 1160 const B.c4(String p) : v = p != 0.0;
1161 const B.c5(String p) : v = p != ''; 1161 const B.c5(String p) : v = p != '';
1162 const B.n1(num p) : v = p != null; 1162 const B.n1(num p) : v = p != null;
1163 const B.n2(num p) : v = null != p; 1163 const B.n2(num p) : v = null != p;
1164 }'''); 1164 }''');
1165 resolve(source); 1165 resolve(source);
1166 assertNoErrors(source); 1166 assertNoErrors(source);
1167 verify([source]); 1167 verify([source]);
1168 } 1168 }
1169 1169
1170 void test_constEvelTypeNum_String() {
1171 Source source = addSource(r'''
1172 const String A = 'a';
1173 const String B = A + 'b';
1174 ''');
1175 resolve(source);
1176 assertNoErrors(source);
1177 verify([source]);
1178 }
1179
1170 void test_constMapKeyExpressionTypeImplementsEquals_abstract() { 1180 void test_constMapKeyExpressionTypeImplementsEquals_abstract() {
1171 Source source = addSource(r''' 1181 Source source = addSource(r'''
1172 abstract class B { 1182 abstract class B {
1173 final id; 1183 final id;
1174 const B(this.id); 1184 const B(this.id);
1175 String toString() => 'C($id)'; 1185 String toString() => 'C($id)';
1176 /** Equality is identity equality, the id isn't used. */ 1186 /** Equality is identity equality, the id isn't used. */
1177 bool operator==(Object other); 1187 bool operator==(Object other);
1178 } 1188 }
1179 1189
(...skipping 4176 matching lines...) Expand 10 before | Expand all | Expand 10 after
5356 resolve(source); 5366 resolve(source);
5357 assertNoErrors(source); 5367 assertNoErrors(source);
5358 verify([source]); 5368 verify([source]);
5359 reset(); 5369 reset();
5360 } 5370 }
5361 5371
5362 void _check_wrongNumberOfParametersForOperator1(String name) { 5372 void _check_wrongNumberOfParametersForOperator1(String name) {
5363 _check_wrongNumberOfParametersForOperator(name, "a"); 5373 _check_wrongNumberOfParametersForOperator(name, "a");
5364 } 5374 }
5365 } 5375 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698