Skip to content

Commit 24041fe

Browse files
committed
Use opaque TypeName instead of alias itself
1 parent ca0ae08 commit 24041fe

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

chalk-solve/src/clauses/program_clauses.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,20 @@ impl<I: Interner> ToProgramClauses<I> for OpaqueTyDatum<I> {
131131
/// where `!T<..>` is the placeholder for the unnormalized type `T<..>`.
132132
fn to_program_clauses(&self, builder: &mut ClauseBuilder<'_, I>) {
133133
let interner = builder.interner();
134+
let substitution = builder.substitution_in_scope();
134135
let alias = AliasTy::Opaque(OpaqueTy {
135136
opaque_ty_id: self.opaque_ty_id,
136-
substitution: builder.substitution_in_scope(),
137+
substitution: substitution.clone(),
137138
});
138139

139-
let alias_ty = Ty::new(interner, alias.clone());
140+
let alias_ty = Ty::new(
141+
interner,
142+
ApplicationTy {
143+
name: TypeName::OpaqueType(self.opaque_ty_id),
144+
substitution,
145+
}
146+
.cast(interner),
147+
);
140148

141149
builder.push_binders(&self.bound, |builder, opaque_ty_bound| {
142150
// AliasEq(T<..> = HiddenTy) :- Reveal.

0 commit comments

Comments
 (0)