1
0

Fix type inference bug

This commit is contained in:
Jeff 2024-06-19 00:09:47 -04:00
parent aa79bea9a7
commit 69da32d414

View File

@ -136,6 +136,11 @@ impl ExpectedType for FunctionCall {
type_parameters, type_parameters,
.. ..
} = function_node_type } = function_node_type
{
if let Type::Generic {
identifier: return_identifier,
..
} = *return_type.clone()
{ {
for (constructor, identifier) in self for (constructor, identifier) in self
.type_arguments .type_arguments
@ -143,11 +148,6 @@ impl ExpectedType for FunctionCall {
.unwrap() .unwrap()
.into_iter() .into_iter()
.zip(type_parameters.unwrap().into_iter()) .zip(type_parameters.unwrap().into_iter())
{
if let Type::Generic {
identifier: return_identifier,
..
} = *return_type.clone()
{ {
if return_identifier == identifier { if return_identifier == identifier {
let concrete_type = constructor.clone().construct(&context)?; let concrete_type = constructor.clone().construct(&context)?;