mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:48:25 +00:00
c559cf04c3
This CL deletes BaseDartTypeVisitor and makes all of the visit* methods in DartTypeVisitor abstract. This forces subclasses of DartTypeVisitor to provide definitions for all of these methods rather than relying on some default. The old code led to a series of bugs with the same root cause: when a new kind of DartType was added (and a corresponding visit* method added to DartTypeVisitor), not all concrete implementations of the visitor were updated to handle the new DartType. This didn't produce static errors because DartTypeVisitor provided default no-op implementations for visit* methods. In some cases, this was the desired behavior anyway, but in practice, any time a new DartType is added, we want our tools to yell at us until we've validated that it's properly handled everywhere (even if the proper handling turns out to be "do nothing"). This CL also updates Namer.getTypeRepresentationForConstant to use a visitor pattern. Fixes: https://github.com/dart-lang/sdk/issues/46589 Change-Id: I451b592ae1ce4afff40de913535798a62e17b8b6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206943 Reviewed-by: Joshua Litt <joshualitt@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com> |
||
---|---|---|
.. | ||
4434_lib.dart | ||
4434_test.dart | ||
4492_test.dart | ||
4515_1_test.dart | ||
4515_2_test.dart | ||
4515_3_test.dart | ||
4639_test.dart | ||
41781_test.dart | ||
43520_safari_test.dart | ||
44818_test.dart | ||
45943_test.dart | ||
46417_test.dart | ||
46589_test.dart | ||
183227419_test.dart | ||
if_method_call_test.dart | ||
regression_type_variables_is_test.dart | ||
scope_info_field_loop_test.dart | ||
unused_generator_type_parameter_test.dart |