fail_mix_in_impl.carbon 638 B

123456789101112131415161718192021222324252627
  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. __mixin Operations {
  10. fn Square[self: Self](x:i32) -> i32{
  11. return x * x;
  12. }
  13. }
  14. interface A {
  15. fn F();
  16. }
  17. external impl i32 as A {
  18. // CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/mixin/fail_mix_in_impl.carbon:[[@LINE+1]]: syntax error, unexpected MIX
  19. __mix Operations;
  20. fn F() {}
  21. }
  22. fn Main() -> i32 { return 0; }