Skip to content

Improve the error when imports are written before a part of directiveΒ #57044

@DanTup

Description

@DanTup

With enhanced parts, it seems imports should be before part directives, but they come after part of directives. This makes some sense, but it's easy to get wrong. If I put an import after a part, I get a clear error message:

image

However the same is not true if I get a part of and import the wrong way around:

image

The error makes it seem like I can't have imports in this file, but in reality I just need to put them after the part of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-uxfeature-enhanced-partsRegarding the 'enhanced-parts' featuretype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions