Commit 94d417d
Fix optional type typecheck to accept nil
SigTyOptionalNode#typecheck was delegating directly to the inner
type's typecheck, which would reject nil values for T? types like
Binding?. Now it skips nil types when checking, since nil is always
valid for optional types.
This fixes false "wrong type of arguments" for calls like
eval("code", nil, "filename") where the second argument is Binding?.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 885d081 commit 94d417d
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
887 | 897 | | |
888 | 898 | | |
889 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments