cbf92d012d
Comments were from: https://codereview.chromium.org/12299008/ https://codereview.chromium.org/11273121/ R=ahe@google.com Review URL: https://codereview.chromium.org//22871009 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26196 260f80e4-7a28-3924-810f-c04153c831b5
28 lines
540 B
Dart
28 lines
540 B
Dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Test that a parameter used in a closure is properly boxed.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
abstract class S {
|
|
S() {
|
|
Expect.equals(2, this.f());
|
|
}
|
|
|
|
get f;
|
|
}
|
|
|
|
class A extends S {
|
|
var f;
|
|
A(a) : f = (() => ++a) {
|
|
Expect.equals(a, 2);
|
|
}
|
|
}
|
|
|
|
main() {
|
|
var a = new A(1);
|
|
Expect.equals(a.f(), 3);
|
|
}
|