Skip to content

SVGCircleElement incorrectly extends SVGGraphicsElement, not SVGGeometryElement #29573

@T99

Description

@T99

TypeScript Version: 3.2.1

Search Terms:
TS2344: Type 'SVGCircleElement' does not satisfy the constraint 'SVGGeometryElement'.
SVGCircleElement cannot extend SVGGeometryElement
TypeScript skips SVGGeometryElement in the inheritance/prototypal chain

Code

class A<E extends SVGGeometryElement> { ... }
class B extends A<SVGCircleElement> { ... } // <-- TS2344 occurs here.

Expected behavior: SVGCircleElement would satisfy the constraint of 'E extends SVGGeometryElement'.

Actual behavior: TypeScript gives a TS2344 error upon attempting to compile the above code.

Playground Link:
Here

Related Issues:
I couldn't find any other related issues in the TypeScript repo, but I did find the following:
Type extension doesn't work for SVG elements

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions