Skip to content

Commit 4513572

Browse files
samwgoldmanfacebook-github-bot
authored andcommitted
Don't create quantified vars for dataclass converters
Summary: When we create a fresh quantified var, we need to finalize it. This code was creating the var, but never finalizing it. Happily, in this case we don't need to create vars at all. Reviewed By: rchen152 Differential Revision: D82337330 fbshipit-source-id: ba291b9299d27e1abc5fa649ccc2bcb729af9240
1 parent 6e12f9f commit 4513572

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrefly/lib/alt/class/dataclass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'a, Ans: LookupAnswer> AnswersSolver<'a, Ans> {
379379
fn get_converter_param(&self, converter: &Type) -> Type {
380380
let converter = {
381381
if let Type::ClassDef(cls) = converter
382-
&& let Type::ClassType(instance) = self.instantiate_fresh_class(cls)
382+
&& let Type::ClassType(instance) = self.promote_silently(cls)
383383
{
384384
let callable = self.constructor_to_callable(&instance);
385385
&self.distribute_over_union(&callable, |ty| {

0 commit comments

Comments
 (0)