Completing a type no longer ignores facet types (#5004)

Make facet types complete like other types. This means that in the body
of an interface, the type of `Self` is incomplete. This involved fixing
an issue where eval of a specific_id that was already canonical was not
resolving the specific declaration, which could occur as part of
substituting into a facet type.

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
josh11b
2025-02-22 21:40:43 +00:00
committed by GitHub
co-authored by Josh L Richard Smith Dana Jansens
parent 1d48270dc4
commit 3ebd098597
25 changed files with 184 additions and 145 deletions
-12
View File
@@ -16,11 +16,6 @@ interface I {
// you can't pass a facet around at runtime, so make sure it works.
fn F(T: I) -> I { return T; }
interface J;
// Declared-but-not-defined interfaces are still complete types.
fn G(T: J) {}
// CHECK:STDOUT: ; ModuleID = 'basic.carbon'
// CHECK:STDOUT: source_filename = "basic.carbon"
// CHECK:STDOUT:
@@ -29,11 +24,6 @@ fn G(T: J) {}
// CHECK:STDOUT: ret void, !dbg !7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define void @_CG.Main() !dbg !8 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret void, !dbg !9
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
// CHECK:STDOUT: !llvm.dbg.cu = !{!2}
// CHECK:STDOUT:
@@ -45,5 +35,3 @@ fn G(T: J) {}
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 19, scope: !4)
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 22, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !9 = !DILocation(line: 22, column: 1, scope: !8)