Files
sdk/pkg/front_end/testcases/nnbd/dynamic_object_call.dart
T
Johnni Winther 3788a59c6c [cfe] Remove ObjectAccessTargetKind.unresolved
Change-Id: I39fd278531038829ea28a870b6333918e4a6bf38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146261
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-05-05 09:00:23 +00:00

27 lines
687 B
Dart

// Copyright (c) 2020, 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.
class Class {
@override
noSuchMethod(Object o, {String foo = ''}) => 42;
@override
toString({String foo = ''}) => 'foo';
}
main() {}
test() {
dynamic c = new Class();
var v1 = c.toString();
var v2 = c.toString(foo: 42);
var v3 = c.toString;
var v4 = c.hashCode;
var v5 = c.hashCode();
// TODO(johnniwinther): Avoid compile-time error here.
var v6 = c.noSuchMethod("foo");
var v7 = c.noSuchMethod("foo", foo: 42);
var v8 = c.noSuchMethod;
}