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 generic method calls with multi generic types (fix #20330) #20360

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

shove70
Copy link
Contributor

@shove70 shove70 commented Jan 3, 2024

  1. Fixed Generic method for a generic struct expects the struct's type #20330
  2. Add tests.
module main

struct Test[T] {}

fn (t Test[T]) abc[U]() {
	t.xyz[U]()
}

fn (t Test[T]) xyz[U]() {}

fn main() {
	t := Test[string]{}
	t.abc[f32]()
	t.abc[u32]()
}

outputs:

passed

@shove70
Copy link
Contributor Author

shove70 commented Jan 3, 2024

CI seems unrelated.

@spytheman
Copy link
Member

CI seems unrelated.

Yes, vinix changed :-| . I've disabled the CI workflow for now, and will fix it soon.

@spytheman spytheman changed the title checker: fix generic method calls with multi generic types(fix #20330) checker: fix generic method calls with multi generic types (fix #20330) Jan 3, 2024
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 00a2356 into vlang:master Jan 3, 2024
53 of 54 checks passed
@shove70 shove70 deleted the generics_both branch January 3, 2024 21:57
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.

Generic method for a generic struct expects the struct's type
2 participants