fail_method_deduced.carbon 503 B

123456789101112131415161718192021
  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. // NOAUTOUPDATE
  6. package ExplorerTest api;
  7. class C {
  8. fn F() {}
  9. fn G[self: Self]() {}
  10. }
  11. fn H[T:! type](x: T) {}
  12. fn Main() -> i32 {
  13. H(C.F);
  14. // CHECK:STDERR: COMPILATION ERROR: fail_method_deduced.carbon:[[@LINE+1]]: member name G can only be used in a member access or alias
  15. H(C.G);
  16. return 0;
  17. }