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

Side by Side Diff: tests/compiler/dart2js/constant_expression_test.dart

Issue 2471543004: Fix compiler crash when we declare several (global) variables, but only define some of them. (Closed)
Patch Set: cleanup Created 4 years, 1 month 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 constant_expression_test; 5 library constant_expression_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 import 'package:compiler/src/constants/expressions.dart'; 10 import 'package:compiler/src/constants/expressions.dart';
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 }), 140 }),
141 ]), 141 ]),
142 const TestData( 142 const TestData(
143 ''' 143 '''
144 class A<T> implements B { 144 class A<T> implements B {
145 final field1; 145 final field1;
146 const A({this.field1:42}); 146 const A({this.field1:42});
147 } 147 }
148 class B<S> implements C { 148 class B<S> implements C {
149 const factory B({field1}) = A<B<S>>; 149 const factory B({field1}) = A<B<S>>;
150 // TODO(johnniwinther): Enable this when the constructor evaluator doesn't
Emily Fortuna 2016/11/02 00:05:25 seemed like this was enabled given the below line
Johnni Winther 2016/11/02 10:41:31 Acknowledged.
151 // crash:
152 const factory B.named() = A<S>; 150 const factory B.named() = A<S>;
153 } 151 }
154 class C<U> { 152 class C<U> {
155 const factory C({field1}) = A<B<double>>; 153 const factory C({field1}) = A<B<double>>;
156 } 154 }
157 ''', 155 ''',
158 const [ 156 const [
159 const ConstantData('const A()', ConstantExpressionKind.CONSTRUCTED, 157 const ConstantData('const A()', ConstantExpressionKind.CONSTRUCTED,
160 type: 'A<dynamic>', fields: const {'field(A#field1)': '42'}), 158 type: 'A<dynamic>', fields: const {'field(A#field1)': '42'}),
161 const ConstantData( 159 const ConstantData(
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 String expected = data.fields[name]; 243 String expected = data.fields[name];
246 Expect.equals( 244 Expect.equals(
247 expected, 245 expected,
248 expression, 246 expression,
249 "Unexpected field expression ${expression} for field '$name' in " 247 "Unexpected field expression ${expression} for field '$name' in "
250 "contant `${constant.toDartText()}`, expected '${expected}'."); 248 "contant `${constant.toDartText()}`, expected '${expected}'.");
251 }); 249 });
252 } 250 }
253 }); 251 });
254 } 252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698