TypeScript/tests/cases/conformance
Nathan Shively-Sanders 6ca9d04b60
Constructor functions as classes (#32944)
* Initial implementation

The original test passes but I haven't run any other tests yet, so I
assume the world is now broken.

* Append constructor function construct sigs

Instead of overwriting them

* Grab bag of improvements.

1. Mark @class-tagged functions with Class too.
2. Only gather local type parameters of constructor functions.
3. Remove getJSClassType calls with getDeclaredTypeOfSymbol.
4. Add a couple more failing tests.

getDeclaredTypeOfClassOrInterface now needs to understand prototype
assignment. That's next, I think.

* Prototype assignments work now

1. Binder marks prototype assignments as Class now.
2. Checker merges prototype assignments using the same merge code as for
functions and their declarations. No more intersections.

Many fewer failing tests now.

* Mark prototype-property assignments as Class

Even if there are no this-property assignments in them. (Then why are
you using a class?).

* Simplify getJSClassType, remove calls to its guts

It's probably not needed because now it's just a conditional call to
getDeclaredTypeOfSymbol, and I think most callers already know whether
they have a JS constructor function beforehand.

* isJSDocConstructor doesn't need to check prototype anymore

Because all the properties are merged during getDeclaredTypeOfSymbol.

* outer type parameter lookup follow prototype assignment

* this-type and -expression support in ctor funcs

Pretty cool!

* Fix remaining tests

* Fix minor lint

* Delete now-unused code

* Add class flag to nested class declarations

Also remove old TODOs
2019-08-19 14:12:53 -07:00
..
ambient Add bad test case 2019-04-24 08:44:24 -07:00
async Prevent substitution of 'super' in async super helper 2019-03-19 11:35:18 -07:00
classes Allow accessors in ambient class declarations (#32787) 2019-08-09 16:11:25 -07:00
constEnums fix compiler crash (#25925) 2019-04-25 10:51:36 -07:00
controlFlow Control flow for element access expressions (#31478) 2019-07-16 10:10:58 -07:00
declarationEmit Merge branch 'master' into attach_property_to_default_export 2019-03-22 17:40:37 +08:00
decorators Change the type of 'uriComponent' (passed to 'encodeURIComponent') from 'string' to 'string | number | boolean'. Fixes #18159 (#31103) 2019-04-26 13:07:14 -07:00
dynamicImport Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
emitter Merge branch 'master' into es2019 2019-02-07 10:08:26 +09:00
enums disallow nan and infinity in enum member 2018-05-04 10:28:59 +08:00
es6 Improve type checking and inference for Generators and Async Generators (#30790) 2019-07-03 21:55:59 -07:00
es7 Allow trailing commas after-rest elements in destructuring 2018-06-04 14:58:30 -07:00
es2017 Fix #21089: Do not infer from numeric index signature in Object.values and Object.entries (#21129) 2018-01-17 14:16:11 -08:00
es2018 Change esnext.promise to es2018.promise (#22292) 2018-03-02 17:08:36 -08:00
es2019 Add support for import.meta in System modules (#32797) 2019-08-12 13:00:58 -07:00
expressions Merge pull request #32077 from andrewbranch/bug/31114 2019-07-03 10:10:10 -07:00
externalModules Add test 2019-04-08 09:46:47 -07:00
functions Add tests 2018-12-10 09:45:55 -08:00
generators Get contextual type of yield from contextual signature of containing function (#32433) 2019-07-16 17:16:21 -07:00
interfaces A merged interface with an inherited member should satisfy an abstract base class member (#32539) 2019-08-01 09:34:11 -07:00
internalModules
jsdoc Constructor functions as classes (#32944) 2019-08-19 14:12:53 -07:00
jsx Fix unicode escapes in jsx identifiers and extended unicode characters in jsdoc (#32716) 2019-08-06 15:14:32 -07:00
moduleResolution Fix handling of empty 'types', 'typings', etc. fields in package.json (#31539) 2019-05-23 17:19:32 -07:00
parser Add test for parenthesized variable and function keyword within ternary 2019-04-01 14:11:30 -07:00
references Update Harness.compileFiles to use vfs 2017-11-09 16:01:33 -08:00
salsa Constructor functions as classes (#32944) 2019-08-19 14:12:53 -07:00
scanner Add error message for keywords with escapes in them (#32718) 2019-08-12 16:00:38 -07:00
statements Reset error record in downlevel for-of (#31519) 2019-05-22 11:18:07 -07:00
Symbols
types add baseline for unknown type spread 2019-08-19 16:32:09 +03:00
typings Only suggest adding to types if present in compilerOptions 2018-10-30 21:31:22 +01:00
fixSignatureCaching.ts Property assignments in Typescript (#26368) 2018-08-15 15:25:25 -07:00