fail_no_member.carbon 573 B

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