Two tests in LanguageFeatures/Private-fields-promotion expect to be able to type promote fields of a static value #2307
Labels
bad-test
Report tests in need of updates. When closed, the tests should be considered good
The tests
LanguageFeatures/Private-fields-promotion/promotion_A01_t07
andLanguageFeatures/Private-fields-promotion/promotion_A01_t08
both contain code that looks roughly like this:For Dart 3.2, field promotion only considers an expression of the form
target._fieldName
to be stable (and thus promotable) if_fieldName
represents a promotable field andtarget
is one of the following:this
(includes implicit uses ofthis
, so bare_fieldName
is considered promotable inside an instance method of a class)super
target._fieldName
that's considered stable.We have considered expanding this list to include static constant fields such as
E.e1
(dart-lang/language#3326), but we haven't done so; if we do decide to make this change, we won't make it until a future Dart release.Accordingly, these two tests need to be updated so that they don't expect expressions like
E.e1._x
to undergo type promotion.The text was updated successfully, but these errors were encountered: