fail_impl_bad_assoc_const.carbon 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. interface I { let T:! type; }
  7. // CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: ERROR: Semantics TODO: `impl of interface with associated constant`.
  8. // CHECK:STDERR: impl bool as I {}
  9. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  10. impl bool as I {}
  11. // CHECK:STDOUT: --- fail_impl_bad_assoc_const.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %.1: type = interface_type @I [template]
  15. // CHECK:STDOUT: %.2: type = assoc_entity_type @I, type [template]
  16. // CHECK:STDOUT: %.3: <associated type in I> = assoc_entity element0, @I.%T [template]
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: file {
  20. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  21. // CHECK:STDOUT: .I = %I.decl
  22. // CHECK:STDOUT: }
  23. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {}
  24. // CHECK:STDOUT: impl_decl @impl {
  25. // CHECK:STDOUT: %I.ref: type = name_ref I, %I.decl [template = constants.%.1]
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: interface @I {
  30. // CHECK:STDOUT: %Self: I = bind_symbolic_name Self [symbolic]
  31. // CHECK:STDOUT: %T: type = assoc_const_decl T [template]
  32. // CHECK:STDOUT: %.loc7: <associated type in I> = assoc_entity element0, %T [template = constants.%.3]
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: !members:
  35. // CHECK:STDOUT: .Self = %Self
  36. // CHECK:STDOUT: .T = %.loc7
  37. // CHECK:STDOUT: witness = (%T)
  38. // CHECK:STDOUT: }
  39. // CHECK:STDOUT:
  40. // CHECK:STDOUT: impl @impl: bool as I {
  41. // CHECK:STDOUT: !members:
  42. // CHECK:STDOUT: witness = <error>
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: