Repository navigation
Commit df8bf16
authored
[refine](core) add compile-time safety checks to assert_cast (apache#63133)
### What problem does this PR solve?
Issue Number: N/A
Problem Summary:
`assert_cast` previously only performed runtime type checks (via
`typeid` comparison). Misuse — such as casting between unrelated types
or upcasting — would only be caught at runtime, making it easy for
incorrect usage to slip into release builds where
`TypeCheckOnRelease::DISABLE` turns checks into `static_cast` without
any verification.
This catches invalid casts at build time instead of producing undefined
behavior or hard-to-diagnose runtime errors.1 parent ab7f8a6 commit df8bf16
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| |||
0 commit comments