dart-lang / code_builder

A fluent API for generating valid Dart source code
https://pub.dev/packages/code_builder
BSD 3-Clause "New" or "Revised" License
427 stars 66 forks source link

Only add `late` modifier if null safety emitting is enabled #370

Closed alanrussian closed 2 years ago

alanrussian commented 2 years ago

In #310 we added support for the late modifier. As far as I understand, the late emitter is only supported in null-safe code. However, I noticed that we emit the late modifier even when DartEmitter is constructed with useNullSafetySyntax set to false.