I'm working on a NavtiveScript project (Typescript-based). On my local environment(using tns cli), it compiled and work fine.
However, when I sync it back (git pull/push) to Telrike platform (IDE), TS compiler erroring out some semantic errors.
SemanticError: Generic type
'Promise<T, R>'
requires 2 type argument(s)
I thought something went wrong with the syncing process. So I created a new NativeScript app using HelloWord template with typescript enabled via in-browser client.
I created a simple class(TestES6) as below. Again, I got same result that same errors during compilation.
class TestES6 {
public bar(p: Promise) {}
// SemanticError: Generic type 'Promise<T, R>' requires 2 type argument(s)
public foo<T>(p: Promise<T>){}
// // SemanticError: Generic type 'Promise<T, R>' requires 2 type argument(s)
public foobar<T,R>(p: Promise<T,R>){}
// compiled!
}
By looking into 'es6-promise.d' which is included in the tns-core-modules. Promise is been defined as Promise<R> not as Promise<T,R>.
And according TS #6248 , I think Telerik TS compiler getting additional type definition of Promise<T>.
Can you please confirm this, or I'm doing something wrong in here?