floitsch@google.com | 52154a8 | 2012-06-25 14:01:55 +0000 | [diff] [blame] | 1 | // 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.com | 8fd6d0a | 2013-04-05 19:43:16 +0000 | [diff] [blame] | 6 | import "package:expect/expect.dart"; |
| 7 | |
floitsch@google.com | 52154a8 | 2012-06-25 14:01:55 +0000 | [diff] [blame] | 8 | class A {} |
| 9 | |
| 10 | A foo() => null; |
| 11 | |
| 12 | main() { |
| 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 | } |