Skip to content

checker: allow foo(?i64(123)) where param is ?I64; where I64 is i64 alias - #23373

Merged
spytheman merged 3 commits into
vlang:masterfrom
Delta456:allow_alias_optional
Jan 5, 2025
Merged

spytheman merged 3 commits into
vlang:masterfrom
Delta456:allow_alias_optional

Conversation

@Delta456

@Delta456 Delta456 commented Jan 4, 2025 •

Copy link
Copy Markdown
Member

This PR compiles the following code

type I64 = i64

fn test(x ?I64) {
}

fn main() {
    test(?i64(123))
}

Before this, it was a checker error

repro.v:7:7: error: cannot use `?i64` as `?I64`, it must be unwrapped first in argument 1 to `test`
    5 | 
    6 | fn main() {
    7 |     test(?i64(123))
      |          ~~~~~~~~~
    8 | }

Huly®: V_0.6-21804

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman
spytheman merged commit af1ef92 into vlang:master Jan 5, 2025
@Delta456
Delta456 deleted the allow_alias_optional branch January 5, 2025 08:37
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.

2 participants