fail_no_member.carbon 648 B

12345678910111213141516171819202122
  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 ExplorerTest api;
  9. interface GetX {
  10. fn DoIt[self: Self]() -> i32;
  11. }
  12. impl forall [template T:! type] T as GetX {
  13. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/template/fail_no_member.carbon:[[@LINE+1]]: member access, unexpected i32 in self.x
  14. fn DoIt[self: Self]() -> i32 { return self.x; }
  15. }
  16. fn Main() -> i32 {
  17. return 0.(GetX.DoIt)();
  18. }