[dart:js_interop] Warn that @anonymous and @staticInterop don't do anything on extension types #55581
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
web-js-interop
Issues that impact all js interop
@anonymous
was meant for JS interop classes that represent an arbitrary object. Historically, it was needed in order to make a difference in how JS interop classes are typed by the compiler. Today, the only difference it makes is allow users to use named argument constructors that create object literals instead of named constructors.With interop extension types, this is no longer needed. Any external constructor (factory or otherwise) that has at least one named argument is considered an object literal constructor: https://dart.dev/interop/js-interop/usage#interop-type-members. Therefore, we should warn that this annotation does nothing on extension types.
Similarly,
@staticInterop
also does nothing on extension types. Extension types by definition can only use static dispatch.The text was updated successfully, but these errors were encountered: