Skip to content

Fix optional type typecheck to accept nil#425

Merged
mame merged 1 commit intomasterfrom
optional-nil-typecheck
Apr 7, 2026
Merged

Fix optional type typecheck to accept nil#425
mame merged 1 commit intomasterfrom
optional-nil-typecheck

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Apr 7, 2026

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?.

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>
@mame mame merged commit 1346fca into master Apr 7, 2026
6 checks passed
@mame mame deleted the optional-nil-typecheck branch April 7, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant