google / reflectable.dart

Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques. The use of dynamic reflection is constrained in order to ensure that the specialized code can be generated and will have a reasonable size.
https://pub.dev/packages/reflectable
BSD 3-Clause "New" or "Revised" License
381 stars 57 forks source link

Remove language version 2.12 #302

Closed eernstg closed 1 year ago

eernstg commented 1 year ago

The reflectable code generator generates the language version comment // @dart = 2.9 when the program uses unsound null safety (that is: at least one library is not null safe). It used to use // @dart = 2.12 in programs using sound null safety. However, that's harmful because it prevents usage of more recent language features in the generated code. (In particular, constant expressions may do this, because they are built from expressions in libraries that are part of the target program.)

This PR removes the language version comments from every generated library which would have had // @dart = 2.12, which means that it will use the default language version of the package that it is generated into.

The PR prepares reflectable for release as 4.0.3 as well.

eernstg commented 1 year ago

Thanks!