连接typescript上的映射生成属性不定义错误

连接typescript上的映射生成属性不定义错误,typescript,Typescript,我需要使用typescript连接函数连接两个JSON,如下所示 function mapConcat(){ let mapABC = { a: 5, b: 6, c:3}; let mapAll = {...mapABC , d:8}; } 但是当我编译这个函数时,我的typescript编译器产生了以下错误 TS2339: Property 'mapABC' does not exist on type '{ d: number; a: number; b: number;

我需要使用typescript连接函数连接两个JSON,如下所示

function mapConcat(){
    let mapABC = { a: 5, b: 6, c:3};
    let mapAll = {...mapABC , d:8};
}
但是当我编译这个函数时,我的typescript编译器产生了以下错误

TS2339: Property 'mapABC' does not exist on type '{ d: number; a: number; b: number; c: number; }'.

从这个错误中,我了解到mapABC没有定义。但我把它定义为本地财产。这种连接有什么错误

您有什么版本的typescript?对象排列是在2.1中添加的,在我的2.1.5版本中效果很好。你有什么版本的typescript?对象扩散是在2.1中添加的,在我的2.1.5版本中效果很好