Repository navigation
Conversation
…s withheld for Arguments of type SSAValue
…the operand type. Similar to what ResultValue does.
…d test cases and fake language into tests/ and crates/kirin-test-languages
…doc. and fixed a typo
…ile for the argument
|
How does this interact with type inference? e.g., when you mark certain type as unknown and waiting for inference? |
So going over it now, it does not handle it well. When testing that against this patch, if a value's type is unknown and waiting for the type to be inferred, the verification step panics. Currently, if the type is just None, the verification step just skips it. When the value's type is unknown and its waiting to be inferred, its stored as Result<T::placeholder>. The simplest solution to this without making any additional changes is to also skip when the operand’s type is the placeholder. |
…ers, added Typeresolution for stateents with annotated single operants.
|
Nevermind, moving it into a shared verifier could be future work. |
I was doing something like the following:
and I noticed that for the argument operands, in this case,
did not have any type verification being done, compared to
pub result: ResultValue, which did.We had that #[kirin(type = ...)] was accepted on SSAValue operand fields but ignored. This is because the expr was stored and never emitted. This patch enforces that generated builders now enforce it, ie., we panic if an annotated operand's type is known and differs from the annotation. Unannotated operands and operands whose type is not yet set (such as graph-port placeholders) are skipped.
Note that this only applies to generated stage builders. Parsed IR and direct statement construction still require a separate verification pass.