Commit 954dbc3
Fix false positive OQL type inference for CASE expressions
inferCaseType had two issues producing wrong types:
1. ELSE clause with bare integer literal (e.g., ELSE 0) was treated as
definitive type even when THEN branch couldn't be inferred — bare
integers in ELSE are ambiguous fallback values
2. Nested CASE expressions caused the regex to match inner THEN clauses
instead of outer ones, inferring wrong types
Fixes: skip bare integer literals in ELSE fallback, and return Unknown
for nested CASE (too complex for regex-based inference). MxBuild
validates the actual types at build time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 49b4f23 commit 954dbc3
1 file changed
Lines changed: 21 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
241 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
242 | 252 | | |
243 | 253 | | |
244 | 254 | | |
| |||
250 | 260 | | |
251 | 261 | | |
252 | 262 | | |
253 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
254 | 267 | | |
255 | 268 | | |
256 | | - | |
257 | | - | |
258 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
259 | 276 | | |
260 | 277 | | |
261 | 278 | | |
| |||
0 commit comments