Skip to content

Generate language version specific attributes in incremental generators RegisterPostInitialisationOutput #71299

Closed Answered by chsienki
latonz asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure if we've had this specific request, but definitely seen things similar to it, mainly about allowing generated code to target the highest langver by default. That works when the compiler is up to date but people are using an explicit lower language version, but doesn't work if people are targeting different compiler versions.

In general though, I suppose we (compiler team) might want to consider making the lang version available as a constant for this purpose as it seems useful.

I see two options depending on the scenario:

  1. Always a new compiler, sometimes a lower langver:
  • Do the targets idea above and map the lang version into a constant you can reference. Annoying that you…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@chsienki
Comment options

Answer selected by latonz
@latonz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants