Commit 73bbbd9
refactor: CastExpr queries CastRulesRegistry before operator methods (#17012)
Summary:
CastExpr::applyPeeled() now checks CastRulesRegistry::canCast() before falling back to the per-operator isSupportedFromType()/isSupportedToType() methods. This makes the registry the primary source of truth for cast validation, with operator methods as a fallback for types not yet fully migrated to the registry (e.g., JSON container types like ARRAY<X>→JSON that require recursive type checking).
This is a no-op behavioral change: the registry answers match what operators would answer for all registered types. The fallback path ensures JSON container casts and any future types with complex validation continue to work.
Differential Revision: D992321071 parent 45f6093 commit 73bbbd9
2 files changed
+17
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
782 | 783 | | |
783 | 784 | | |
784 | 785 | | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | 786 | | |
791 | | - | |
792 | | - | |
793 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
794 | 799 | | |
795 | 800 | | |
796 | 801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
0 commit comments