lundi 23 juin 2014

Exported variable has or is using private type TypeScript error


Vote count:

0




The following gets a rather cryptic TypeScript build error: Exported variable 'res' has or is using private type 'Result'.



interface Result {
status: string;
comment: string;
}

function runTest(st: any) {
try {

} catch (err) {
console.log('Failed test task: ' + err);
console.log('Failed test task: ' + st.name);
console.log(err.stack);
var res: Result = {
status: 'bad',
comment: 'Nodejs exception: ' + err,
};
//saveTestResult(st, res);
}
};

export function what() {};


It's all ok if either:



  • Remove the try/catch

  • Don't export the function what


What's going on here?



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire