Issue a more useful error when attempting to construct non-newable type
See original GitHub issueInspired from http://stackoverflow.com/questions/24923772/raphael-with-typescript-call-signatures-used-in-a-new-expression-must-have-a
interface NotNewable {
(n: number): string;
}
var n: NotNewable;
var t = new n(10);
New compiler says
Only a void function can be called with the ‘new’ keyword
Old compiler says
Call signatures used in a ‘new’ expression must have a ‘void’ return type.
This error is written as if it’s the .d.ts author’s fault, not the calling code’s fault. A more useful error would be something like “Specified type does not have a signature that can be called with ‘new’”
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
R.E.A.C.T. - Renewable Energy Activities - NREL
These include sun, wind, geothermal, water, and biomass. The renewable energy resources are important in long range energy planning because they will not...
Read more >Special Report on Renewable Energy Sources and Climate ...
The IPCC Special Report on Renewable Energy Sources and Climate Change Mitigation (SRREN) provides a comprehensive review concerning these sources ...
Read more >Renewable Energy 101 | National Geographic - YouTube
There are many benefits to using renewable energy resources, but what is it exactly? From solar to wind, find out more about alternative ......
Read more >Renewable-energy development in a net-zero world - McKinsey
Global decarbonization will require a massive build-out of wind and solar farms. But can developers find enough land, secure the supply ...
Read more >Breaking barriers in deployment of renewable energy - NCBI
Loss of other/alternative income : A major issue with renewable plants (especially solar and wind farms) is the vast area of land required...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The current error for this kind of thing is:
which seems to satisfy the specified goal of this ticket:
cc @RyanCavanaugh
I’m running into this error a lot when checking legacy javascript code. The obscurity of this message might have made sense back when --noImplicitAny was a hidden compiler flag. howadays, not so much…