| /* |
| * Copyright (c) 2019, 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. |
| */ |
| /** |
| * @assertion An expression of the form e! evaluates e to a value v, throws a |
| * runtime error if v is null, and otherwise evaluates to v. |
| * |
| * @description Check that an expression of the form e! evaluates e to a value |
| * v if v is not null |
| * @author sgrekhov@unipro.ru |
| */ |
| // SharedOptions=--enable-experiment=non-nullable |
| import "../../Utils/expect.dart"; |
| |
| class A {} |
| |
| main() { |
| A a1 = new A(); |
| A? a2 = a1; |
| |
| Expect.equals(a1, a1!); |
| Expect.equals(a1, a2!); |
| |
| String? s = "Lily was here"; |
| Expect.equals("Lily was here", s!); |
| } |