Skip to content

Allow inheritance from intersections #14075

@sandersn

Description

@sandersn

Based on #14017, when exporting a class that extends from a mixin, the emitted type contains an intersection. Inheriting from an intersection is not allowed, even though it should be.

Note that inheriting from a type alias of an intersection already works:

// A *self-contained* demonstration of the problem follows...
class A { a = 1 } 
class B { b = 2 }
type Both = A & B
class C extends A & B { } // error
class D extends Both { } // ok

Expected behavior:
No error for C or D.

Actual behavior:
Error for C.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions