blob: 3a1c64b0cc914fcad480e29db2cebb0d5392e05c [file] [log] [blame]
/*
* Copyright (c) 2021, 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 It is an error to call an expression whose type is potentially
* nullable and not dynamic.
*
* @description Check that it is no compile-time error to call an expression
* whose type is dynamic.
* @author sgrekhov@unipro.ru
*/
// Requirements=nnbd-weak
import "../../../Utils/expect.dart";
int foo() => 42;
typedef int Foo();
main() {
dynamic f1 = foo;
Expect.equals(42, f1());
dynamic f2 = foo;
Expect.equals(42, f2());
}