Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checker: fix type mismatch checking for assignments with generics(fix#20298) #20327

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Jan 1, 2024

  1. Fixed ./v test vlib/v/tests/generics_chans_select_test.v fails #20298
  2. Add tests.

This issue(20298) contains several issues. This PR starts with a simple solution to a type checking problem.
Then split a new issue, and resolve it.

The new issue is a CallExpr may have 2 or block{} :

type Fn = fn ()

struct Struct {
    method ?Fn
}

fn main() {
    s := Struct {
        method: fn () {}
    }

    s.method or_1 {} (args...) or_2 {}
}

or_1 {} for ?Fn
or_2 {} for method call.

@shove70
Copy link
Contributor Author

shove70 commented Jan 1, 2024

new issue:
#20328

Copy link
Member

@spytheman spytheman left a comment

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 41d38d7 into vlang:master Jan 1, 2024
54 checks passed
@shove70 shove70 deleted the types-check-with-generic branch January 1, 2024 12:09
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.

./v test vlib/v/tests/generics_chans_select_test.v fails
2 participants