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

Side by Side Diff: tests/compiler/dart2js_extra/28919_test.dart

Issue 2762493002: Type tracing bug fix for issue 28919. (Closed)
Patch Set: typo Created 3 years, 9 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
« no previous file with comments | « tests/compiler/dart2js/mock_libraries.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5 // Regression test for http://dartbug.com/28919.
6 //
7 // This would crash at runtime because the type of closure parameter 'x' was
8 // empty, leading to bad codegen. The empty type was due to a tracing bug that
9 // failed to escape the closure when stored into the list which was not traced
10 // as a container.
11
12 import 'package:expect/expect.dart';
13
14 int foo([List _methods = const []]) {
15 final methods = new List.from(_methods);
16 for (int i = 0; i < 3; i++) {
17 methods.add((int x) => x + i);
18 }
19 return methods[0](499);
20 }
21
22 main() {
23 Expect.equals(499, foo());
24 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/mock_libraries.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698