Skip to content

Lint for cast to extension type (formerly known as inline class) #59208

@Cat-sushi

Description

@Cat-sushi

I understand that as is a responsibility delegation from the compiler to users.
And, the compiler doesn't check down casts with as, but the runtime does.

On the other hand, the runtime skips user-defined check logic on constructor of inline class.

So, I propose a new lint to warn a cast from the representation type to the inline class with check logic or body on its constructor, without implicit constructor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposallinter-new-language-featuretype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions