mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
Form the contents of the witness table. (#3756)
Check that functions in an `impl` are declared properly. For now, simply reuse the redeclaration checking logic. Longer-term, we need to check that the signatures match in a more approximate way, after substituting the `Self` type into the signature in the `interface`. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
551a6d385e
commit
a1317e61e0
+2
-2
@@ -18,7 +18,7 @@ impl i32 as Simple {
|
||||
// CHECK:STDOUT: %.1: type = interface_type @Simple [template]
|
||||
// CHECK:STDOUT: %.2: type = assoc_entity_type @Simple, <function> [template]
|
||||
// CHECK:STDOUT: %.3: <associated <function> in Simple> = assoc_entity element0, @Simple.%F [template]
|
||||
// CHECK:STDOUT: %.4: <witness> = interface_witness @Simple, () [template]
|
||||
// CHECK:STDOUT: %.4: <witness> = interface_witness @Simple, (@impl.%F) [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -44,7 +44,7 @@ impl i32 as Simple {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: i32 as Simple {
|
||||
// CHECK:STDOUT: %F: <function> = fn_decl @F.2 [template] {}
|
||||
// CHECK:STDOUT: %.1: <witness> = interface_witness @Simple, () [template = constants.%.4]
|
||||
// CHECK:STDOUT: %.1: <witness> = interface_witness @Simple, (%F) [template = constants.%.4]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .F = %F
|
||||
|
||||
Reference in New Issue
Block a user