8000 Allow deriving from object and intersection types by ahejlsberg · Pull Request #13604 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content

Allow deriving from object and intersection types #13604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 21, 2017
Prev Previous commit
Next Next commit
Allow object intersection types in class implements clauses
  • Loading branch information
ahejlsberg committed Jan 19, 2017
commit c51e2867f50de63db151310da03b829d667becc9
3 changes: 1 addition & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18411,8 +18411,7 @@ namespace ts {
if (produceDiagnostics) {
const t = getTypeFromTypeNode(typeRefNode);
if (t !== unknownType) {
const declaredType = getObjectFlags(t) & ObjectFlags.Reference ? (<TypeReference>t).target : t;
if (getObjectFlags(declaredType) & ObjectFlags.ClassOrInterface) {
if (isValidBaseType(t)) {
checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, Diagnostics.Class_0_incorrectly_implements_interface_1);
}
else {
Expand Down
0