blob: a56e705b3f573d8cf9b877b3eb8c55afbeaee302 [file] [log] [blame]
floitsch@google.com52154a82012-06-25 14:01:55 +00001// Copyright (c) 2012, 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// Test correct handling of NULL object in invocation and implicit closures.
5
floitsch@google.com8fd6d0a2013-04-05 19:43:16 +00006import "package:expect/expect.dart";
7
floitsch@google.com52154a82012-06-25 14:01:55 +00008class A {}
9
10A foo() => null;
11
12main() {
13 A nullObj = foo();
14 var x = nullObj.toString();
15 Expect.isTrue(x is String);
16 var y = nullObj.toString;
17 Expect.isNotNull(y);
18}