Closed
Description
TypeSystemImpl was a convenient place to drop in the value of whether "strict casts" has been enabled in an analysis options file, but the treatment of those files is changing (an analysis options file will not be sufficient conditions to create an analysis context), so I think that field needs to move out of TypeSystemImpl. How is it used?
- A few error checkers query
if (typeSystem.strictCasts) ...
. I think these queries can instead poke at the analysis options file which pertains to the library being analyzed. - Inside TypeSystemImpl, the field is used in exactly one position: the
isAssignableTo
function, in order to disable all downcasts. We could instead makebool strictCasts
a parameter on the function. But this function is referenced 59 times (at least?) in the Dart SDK, and they should probably all pass the correct value ofstrictCasts
as per some library's analysis options file.
CC @scheglov @keertip @bwilkerson @pq .