-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This function types #6739
This function types #6739
Commits on Jan 29, 2016
-
Parse this type using parameter syntax
Syntax is the same as a normal parameter: ```ts function f(this: void, x: number) { } ```
Configuration menu - View commit details
-
Copy full SHA for 0a968f0 - Browse repository at this point
Copy the full SHA 0a968f0View commit details -
If `this` is not provided, it defaults to `void` for functions and `this` for methods. The rules for checking are similar to parameter checking, but there's still quite a bit of duplication for this implementation.
Configuration menu - View commit details
-
Copy full SHA for d8a77c0 - Browse repository at this point
Copy the full SHA d8a77c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for a639b71 - Browse repository at this point
Copy the full SHA a639b71View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bd7afb - Browse repository at this point
Copy the full SHA 9bd7afbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca16209 - Browse repository at this point
Copy the full SHA ca16209View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22e571f - Browse repository at this point
Copy the full SHA 22e571fView commit details -
Add overloads for Function.apply/call/bind
The new overloads use this types to specify the return type of these functions as well as the type of `thisArg`.
Configuration menu - View commit details
-
Copy full SHA for 5fe8478 - Browse repository at this point
Copy the full SHA 5fe8478View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04e7d81 - Browse repository at this point
Copy the full SHA 04e7d81View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4f1154 - Browse repository at this point
Copy the full SHA a4f1154View commit details -
1. Display of `this` changes for quick info. 2. The type of Function.call/apply/bind is more precise.
Configuration menu - View commit details
-
Copy full SHA for d030889 - Browse repository at this point
Copy the full SHA d030889View commit details
Commits on Feb 2, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 675e081 - Browse repository at this point
Copy the full SHA 675e081View commit details
Commits on Feb 3, 2016
-
Configuration menu - View commit details
-
Copy full SHA for f6361ce - Browse repository at this point
Copy the full SHA f6361ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8032b06 - Browse repository at this point
Copy the full SHA 8032b06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0af56c0 - Browse repository at this point
Copy the full SHA 0af56c0View commit details
Commits on Feb 4, 2016
-
First round of review comments addressed.
Only major thing is a bug fix in `isContextSensitiveFunctionLikeDeclaration`, and turning on context sensitivity to `this` even with `--strictThis` off.
Configuration menu - View commit details
-
Copy full SHA for 8c87da5 - Browse repository at this point
Copy the full SHA 8c87da5View commit details
Commits on Feb 5, 2016
-
Add specific error messages for out-of-place this
Also remove lint in checker.
Configuration menu - View commit details
-
Copy full SHA for 2f74da1 - Browse repository at this point
Copy the full SHA 2f74da1View commit details -
Refactorings from review comments
1. Add `getThisArgumentOfCall` (and correct the code) 2. Remove `getParameterTypeAtIndex` in favour of `getTypeAtPosition`. Simplify calling code.
Configuration menu - View commit details
-
Copy full SHA for 71488fc - Browse repository at this point
Copy the full SHA 71488fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5821b87 - Browse repository at this point
Copy the full SHA 5821b87View commit details
Commits on Feb 6, 2016
-
Get contextual type of this parameter correctly
Now the language service also sees the contextual type. Note that with this change, the type display for contextually typed this parameters goes away because there is no symbol. I'll fix type display next.
Configuration menu - View commit details
-
Copy full SHA for 80de700 - Browse repository at this point
Copy the full SHA 80de700View commit details
Commits on Feb 8, 2016
-
Improve display and contextual typing of
this
1. Always display `this` type if annotated. 2. Contextually type un-annotated `this` parameters in addition to `this` expressions.
Configuration menu - View commit details
-
Copy full SHA for fa59875 - Browse repository at this point
Copy the full SHA fa59875View commit details -
1. Fix bug in error reporting in compareSignaturesRelated. 2. When the this-argument is a union type, allow assignability when the method's signature is assignable to *any* member of the union.
Configuration menu - View commit details
-
Copy full SHA for 738713b - Browse repository at this point
Copy the full SHA 738713bView commit details
Commits on Feb 9, 2016
-
Revert unioning of this argument types
The right solution is to not instantiate this-types of unions, which is a separate problem more to do with this-class types.
Configuration menu - View commit details
-
Copy full SHA for 41bb446 - Browse repository at this point
Copy the full SHA 41bb446View commit details
Commits on Feb 16, 2016
-
Address more comments and remove temp test.
I added the temp test by mistake.
Configuration menu - View commit details
-
Copy full SHA for a014edf - Browse repository at this point
Copy the full SHA a014edfView commit details -
Configuration menu - View commit details
-
Copy full SHA for e7aa7e4 - Browse repository at this point
Copy the full SHA e7aa7e4View commit details
Commits on Mar 8, 2016
-
Union this-types of unioned call signatures
And and tests and baselines
Configuration menu - View commit details
-
Copy full SHA for 482accc - Browse repository at this point
Copy the full SHA 482acccView commit details
Commits on Mar 9, 2016
-
Check this expressions in object literal methods
Add a test and baseline
Configuration menu - View commit details
-
Copy full SHA for 7b531fc - Browse repository at this point
Copy the full SHA 7b531fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4012587 - Browse repository at this point
Copy the full SHA 4012587View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3297824 - Browse repository at this point
Copy the full SHA 3297824View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa22250 - Browse repository at this point
Copy the full SHA fa22250View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a46e72 - Browse repository at this point
Copy the full SHA 3a46e72View commit details
Commits on Mar 11, 2016
-
Rename --strictThis to --strictThisChecks
Use the upcoming naming scheme for --strict.*Checks and --strictChecks flags.
Configuration menu - View commit details
-
Copy full SHA for 1032cc5 - Browse repository at this point
Copy the full SHA 1032cc5View commit details
Commits on Mar 25, 2016
-
Configuration menu - View commit details
-
Copy full SHA for c9f5f3d - Browse repository at this point
Copy the full SHA c9f5f3dView commit details -
It's basically another --noImplicitAny error, but one that would break large amount of JavaScript-style code.
Configuration menu - View commit details
-
Copy full SHA for a91cdcc - Browse repository at this point
Copy the full SHA a91cdccView commit details
Commits on Mar 28, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 9e5f260 - Browse repository at this point
Copy the full SHA 9e5f260View commit details -
Configuration menu - View commit details
-
Copy full SHA for f64110a - Browse repository at this point
Copy the full SHA f64110aView commit details
Commits on Mar 30, 2016
-
Error on all uses of this that are implicitly any
Previously it was only an error inside an function.
Configuration menu - View commit details
-
Copy full SHA for 0113ad5 - Browse repository at this point
Copy the full SHA 0113ad5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4ed7f9 - Browse repository at this point
Copy the full SHA e4ed7f9View commit details
Commits on Mar 31, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 0060b4d - Browse repository at this point
Copy the full SHA 0060b4dView commit details -
Configuration menu - View commit details
-
Copy full SHA for da98258 - Browse repository at this point
Copy the full SHA da98258View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce68932 - Browse repository at this point
Copy the full SHA ce68932View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81f0d86 - Browse repository at this point
Copy the full SHA 81f0d86View commit details -
Improve error messages and always return any from newed functions
Previously, functions that specified a type for `this` would return that type. Now they return `any`. This helps prevent unintentional use of this feature when --noImplicitAny is turned on. The type of `this` is still checked in the body of these functions.
Configuration menu - View commit details
-
Copy full SHA for 4197a30 - Browse repository at this point
Copy the full SHA 4197a30View commit details
Commits on Apr 1, 2016
-
Prepend 'the' to a couple of ambiguous messages.
Based on feedback from @DanielRosenwasser @Arnavion and @RichiCoder1
Configuration menu - View commit details
-
Copy full SHA for 9e5fba6 - Browse repository at this point
Copy the full SHA 9e5fba6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a9f39b - Browse repository at this point
Copy the full SHA 2a9f39bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 921d5f8 - Browse repository at this point
Copy the full SHA 921d5f8View commit details
Commits on Apr 7, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 6c735b5 - Browse repository at this point
Copy the full SHA 6c735b5View commit details