Repository navigation
Commit bbe4da3
[mono][interp] Preserve nullable boxing for GetType (#132732)
Fixes #132461.
The interpreter optimized `box T` followed by `Object.GetType()` into a
constant type lookup. For `Nullable<T>`, this bypassed nullable boxing
semantics and returned `typeof(Nullable<T>)` instead of the underlying
type.
Exclude `Nullable<T>` from this optimization so it follows the normal
boxing path:
- A populated nullable returns the underlying type.
- A null nullable throws `NullReferenceException`.
Adds regression coverage for the direct `box Nullable<T>; call
Object.GetType()` IL pattern under the Mono interpreter.
> [!NOTE]
> This pull request description was generated by GitHub Copilot.
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Larry Ewing <[email protected]>1 parent cad631f commit bbe4da3
2 files changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5063 | 5063 | | |
5064 | 5064 | | |
5065 | 5065 | | |
5066 | | - | |
| 5066 | + | |
| 5067 | + | |
5067 | 5068 | | |
5068 | 5069 | | |
5069 | 5070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| |||
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
53 | | - | |
| |||
0 commit comments