dart-lang/code_builder

Does code_builder support a notion of target language version?

Opened this issue · 0 comments

yanok commented

Or is it completely up to the user to make sure to only use the supported constructs?

Sometimes (the particular case I'm having at hand is required named arguments) it's possible to handle unsupported constructs gracefully, so for example if a required named argument were requested via builder, the library can generate an actual required arg if version >=2.12 is requested, and just drop the required otherwise.