fail_extend_external.carbon 583 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. // NOAUTOUPDATE
  6. package ExplorerTest api;
  7. class IntHolder {
  8. var n: i32;
  9. }
  10. // CHECK:STDERR: SYNTAX ERROR: fail_extend_external.carbon:[[@LINE+1]]: syntax error, unexpected EXTEND, expecting END_OF_FILE
  11. extend impl IntHolder as ImplicitAs(i32) {
  12. fn Convert[self: Self]() -> i32 { return self.n; }
  13. }
  14. fn Main() -> i32 {
  15. return ({.n = 5} as IntHolder).(ImplicitAs(i32).Convert)();
  16. }