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

Support of union and type approximation in generics #86

Merged
merged 1 commit into from
May 3, 2024

Conversation

zcolleen
Copy link

I discovered that in last version of minimock (v3.3.7) when we upped version of gowrap we broke generation of interfaces with generic unions. It happened because of this pr #84 . So here i introduce support of generic types with union, e.g.

type genericInlineUnionWithManyTypes[T int | float64 | string] interface {
	Name(T)
}

and with type approximations , е.g.

type generic[T ~int] interface {
	Name(T)
}

and their combinations.

I also removed panic of unsupported generic type, because if we encounter unsupported generic type we should be able at least to finish generation without panicing.

@hexdigest hexdigest merged commit 247d1e7 into hexdigest:master May 3, 2024
1 check passed
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.

None yet

2 participants