Skip to content

Add strictCasts API access to lints #54376

@pq

Description

@pq

Follow-up from https://dart-review.googlesource.com/c/sdk/+/341336, with some more context in #53873.

A number of lints call typeSystem.isAssignableTo(...) which now supports a strictCasts flag. They have been updated to access strictCasts like this:

       strictCasts =
            // ignore: deprecated_member_use
            (context.analysisOptions as AnalysisOptionsImpl).strictCasts;

where context is a LinterContext instance.

Since we want to remove strictCasts from options, we need to put the access elsewhere. An easy candidate is the LinterContext but we should kick other ideas around.

Input welcome!

/cc @scheglov @srawlins @bwilkerson

Metadata

Metadata

Assignees

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresanalyzer-analysis-optionsdevexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions