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

Refactor the source generator to be public #371

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

aalmada
Copy link
Member

@aalmada aalmada commented Jul 7, 2021

The compiler is not able to infer the generics types when using constraints. For this reason, a source generator was used to generate all the generics mappings so that a developer doesn't have to explicitly specify the types when calling each operation. The source generator was an internal project, executed before packaging the library.

This refactoring changes the source generator to be publicly distributed and executed when compiling the projects that depend on Hyperlinq. It will only generate the overloads required by the project.

This refactoring is necessary because it's very hard to map the generics types in the way it was done. When executing on the project, the explicit types have already been declared. This makes the source generator much simpler, allows the generation of a lot less code. It can also perform more optimizations.

@aalmada aalmada force-pushed the GeneratorRefactor branch 2 times, most recently from b1c0949 to 639aa73 Compare July 15, 2021 19:29
@aalmada aalmada force-pushed the GeneratorRefactor branch 2 times, most recently from 35ed2b1 to 721fcb2 Compare September 14, 2021 22:02
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