Skip to content

Clearer error message when a class extends an interface #1643

Open
@MatrixFrog

Description

@MatrixFrog

https://closure-compiler-debugger.appspot.com/#input0%3D%252F**%2520%2540interface%2520*%252F%250Aclass%2520MyInterface%2520%257B%257D%250A%250Aclass%2520MyClass%2520extends%2520MyInterface%2520%257B%257D%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26LANG_IN_IS_ES6%3D1%26MISSING_PROPERTIES%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1%26TRANSPILE%3D1

Currently this gives two different errors, and one of them mentions $jscomp.inherits which is totally unhelpful and meaningless to the user. We should:

  1. Only report one error
  2. Make sure it's clear
  3. (bonus) Suggest that the user probably meant to include an @implements annotation in their JSDoc, rather than writing extends

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions