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

Consider replacing the declaration context in GetTypeAsString and associated methods with a proper context enum #238

Open
PathogenDavid opened this issue Feb 15, 2022 · 0 comments
Labels
Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Concept-ApiClarity Issues for improving the clarity of the Biohazrd API TechDebt

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Feb 15, 2022

Historically we've had the declaration associated with the type being written available in the context of getting a type as a string.

This is somewhat problematic because it doesn't actually tell us what the context we're emitting to is. For instance, a temporary local being written for a in T parameter should be written as ref readonly T but we have no way to know that in ByRefTypeReference. Another weird case is writing the implicit parameters for functions, which are associated with the function its self since no actual parameter exists.

We also actually rarely use it for context beyond debugging, it'd be better to only use it for debugging, remove it from public API locations like ICustomCSharpTypeReference, and replace it with an EmitContext enum.

Additionally it's actually somewhat annoying to determine in some situations. For instance, we have to do a lot of extra work in Trampoline for very little gain in order to figure out which parameter is indirectly associated with an adapter.

@PathogenDavid PathogenDavid added Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Concept-ApiClarity Issues for improving the clarity of the Biohazrd API TechDebt labels Feb 15, 2022
@PathogenDavid PathogenDavid mentioned this issue Feb 15, 2022
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-OutputGeneration Issues concerning the process of generating output from Biohazrd Concept-ApiClarity Issues for improving the clarity of the Biohazrd API TechDebt
Projects
None yet
Development

No branches or pull requests

1 participant