sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[analyzer] Imprecise error when implementing non-existing type

Open parlough opened this issue 1 year ago • 1 comments

A class declaration trying to import a non-existing type results in the implements_non_class diagnostic rather than pointing out that the type doesn't exist.

class A implements B {
               /// ^ [analyzer] Classes and mixins can only implement other classes and mixins.
               /// ^ [cfe] Error: Type 'B' not found.
}

The CFE does a better job here, both calling out the type and indicating the type can't be found.

parlough avatar Feb 02 '24 04:02 parlough

Assuming it's only valid to implement classes, I would recommend that we generate an (existing) undefined_class diagnostic instead.

bwilkerson avatar Jun 06 '25 20:06 bwilkerson