blob: 1c451e6d3e146680c26b8dac1f27ff64cad20957 [file] [log] [blame]
// 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 We do not allow implicit tear-off of an extension call method in a
/// function typed context.
///
/// @description Check that implicit tear-off of an extension call method in a
/// function typed context is a compile-time error
/// @author sgrekhov@unipro.ru
extension on int {
String call(int v) => "Result: $v";
}
String Function(int) from1 = 1;
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] A value of type 'int' can't be assigned to a variable of type 'String Function(int)'.
main() {
String Function(int) from2 = 2;
// ^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// [cfe] A value of type 'int' can't be assigned to a variable of type 'String Function(int)'.
}