Closed michaellperry closed 2 years ago
I've declared a generic function in a TypeScript file:
export function create<T>(template: T): Wrapper<T> { return new Wrapper<T>(template); }
When I call the function from a Notebook, the answer is the boolean false.
false
const template: Product = {} const product = create<Product>(template) product
If I remove the explicit generic and allow the type to be inferred, an object is returned.
const template: Product = {} const product = create(template) product
Wrapper {}
Repro attached:
Repro.zip
Thanks for filing this issue, I've been able to repro this. Apologies for the delay
I've declared a generic function in a TypeScript file:
When I call the function from a Notebook, the answer is the boolean
false
.If I remove the explicit generic and allow the type to be inferred, an object is returned.
Repro attached:
Repro.zip