Commit 7224813
committed
fix: Handle enum patterns against non-enum scrutinee types
When an enum pattern (like .none) is matched against a non-enum type
(like i32), the pattern test now correctly returns false instead of
trying to extract a discriminant from the integer, which would cause
an LLVM error (ExtractValue can only be used on struct/array types).1 parent e0f743f commit 7224813
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3971 | 3971 | | |
3972 | 3972 | | |
3973 | 3973 | | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
3974 | 3993 | | |
3975 | 3994 | | |
3976 | 3995 | | |
| |||
0 commit comments