blob: a7aa0a80e536f8c6724fe2a063ed4a1dc6a45ff1 [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.
// @dart = 2.9
/// @assertion This means that you cannot do cascade invocations on explicit
/// extension applications: E(e)..foo()..bar() is a compile-time error. This is
/// necessary because that expression evaluates to the value of E(e), and an
/// extension application does not have a value.
///
/// @description Check that cascade invocations cannot be applied to explicit
/// extension invocation
/// @author sgrekhov@unipro.ru
class C {
}
extension Ext on C {
int foo() => 42;
int bar() => 43;
}
main() {
C c = C();
Ext(c)
//^^^
// [analyzer] unspecified
// [cfe] unspecified
..foo()
..bar();
}