Closed
Description
TypeScript Version: 3.5.2
Search Terms:
spread operator type error, Object.assign,
Code
abstract class Base {
abstract get a(): string;
abstract get b(): string;
}
class A extends Base{
a: string
b: string
}
const a1 : Base = new A()
const a2 : Base = {...a1} //reports error: Type '{}' is missing the following properties from type 'Base': a, bts(2739)
const a3 : Base = a1
const a4 : Base = Object.assign({}, a1)
Expected behavior:
code compiles
Actual behavior:
reports error on a2
Type '{}' is missing the following properties from type 'Base': a, bts(2739)
Related Issues: