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

Side by Side Diff: tests/language/closure_in_field_test.dart

Issue 2994383003: Avoid crash for type variables in mixed in fields. (Closed)
Patch Set: Created 3 years, 4 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
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 // Test handling of type variable in field initializers.
6
7 import 'package:expect/expect.dart';
8
9 class Mixin<S> {
10 var field = (S s) => null;
11 }
12
13 class Class<T> extends Object with Mixin<T> {}
14
15 void main() {
16 Expect.isTrue(test(new Mixin<int>()));
17 Expect.isFalse(test(new Mixin<String>())); //# 01: ok
18 Expect.isTrue(test(new Class<int>()));
19 Expect.isFalse(test(new Class<String>())); //# 02: ok
20 }
21
22 test(o) => o.field is dynamic Function(int);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698