fail_qualified_non_member.carbon 717 B

1234567891011121314151617
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package Foo api;
  9. fn F[self: i32]() {}
  10. fn Main() -> i32 {
  11. // TODO: It's unclear whether this is valid per the current rules. See
  12. // https://github.com/carbon-language/carbon-lang/pull/1122
  13. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/member_access/fail_qualified_non_member.carbon:[[@LINE+1]]: expected name of instance member or interface member in compound member access, found fn () -> ()
  14. 42.(F)();
  15. return 0;
  16. }