Skip to content

Commit 3a1ba48

Browse files
committed
Check that base types are not never-like
1 parent 7ae4a21 commit 3a1ba48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8333,8 +8333,8 @@ namespace ts {
83338333
}
83348334
// TODO: Given that we allow type parmeters here now, is this `!isGenericMappedType(type)` check really needed?
83358335
// There's no reason a `T` should be allowed while a `Readonly<T>` should not.
8336-
return !!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive | TypeFlags.Any)) && !isGenericMappedType(type) ||
8337-
!!(type.flags & TypeFlags.Intersection) && every((<IntersectionType>type).types, isValidBaseType);
8336+
return !!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive | TypeFlags.Any) && !isGenericMappedType(type) ||
8337+
type.flags & TypeFlags.Intersection && !isNeverLikeType(type) && every((<IntersectionType>type).types, isValidBaseType));
83388338
}
83398339

83408340
function resolveBaseTypesOfInterface(type: InterfaceType): void {

0 commit comments

Comments
 (0)