回复:RE: How to change IR type?

In general you can use Value::mutateType to change the type of a value. You can’t change the types arbitrarily though, I think that the operands to “add” still need to have the same type.

int i = {1,2,3};

in my compiler I first create an array type with length is 0, then create a new type which length is 3 after the initializer is evaluated.

I tried the API mutateType, but it doesn’t work as expected. So just delete the old one and create a new one.

That’s my suggestion.