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
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
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