Remove dependence on specific Info
s
#462
Labels
bug
Something isn't working
C: Internals
Component: Compiler internals
good first issue
Good for newcomers
@ethanuppal has mentioned issues that arise when every info is set to empty. This is something that arises from the
info_cast
macro defined in info.rs:filament/crates/ir/src/info.rs
Lines 264 to 298 in 1f95254
It defines the
From
trait for infos, which panics if the incorrect info type is found. This is used in certain locations primarily to generateir::Info::Reason
s for constraints (some listed below). These should theoretically just returnInfo::Empty
if either of the parents is missing, rather than panicking, so that we could remove the dependency oninfo
entirely throughout the IR.We should instead implement
TryFrom
or instead just directly force the user to use theas_type
functions that are already defined.Non-exhaustive examples
filament/crates/filament/src/ir_passes/type_check.rs
Lines 28 to 36 in 1f95254
filament/crates/filament/src/ir_passes/interval_check.rs
Lines 91 to 112 in 1f95254
The text was updated successfully, but these errors were encountered: