// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon // // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/method/fail_method.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/method/fail_method.carbon class Class { fn NoSelf(); fn WithSelf(self: Class); } alias A = Class.WithSelf; fn F(c: Class) { c.NoSelf(); c.WithSelf(); Class.NoSelf(); // CHECK:STDERR: fail_method.carbon:[[@LINE+3]]:3-18: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: fail_method.carbon:[[@LINE-11]]:3-27: note: calling function declared here [InCallToEntity] // CHECK:STDERR: Class.WithSelf(); Class.WithSelf(c); // CHECK:STDERR: fail_method.carbon:[[@LINE+3]]:3-5: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: fail_method.carbon:[[@LINE-17]]:3-27: note: calling function declared here [InCallToEntity] // CHECK:STDERR: A(); }