5815 Commits

Author SHA1 Message Date
Daniel Rosenwasser
d8d72aabae Separated the concept of apparent types from contextual types for string literal types.
In most cases, expressions are interested in the apparent type of the
contextual type. For instance:

    var x = { hasOwnProperty(prop) { /* ... */ };

In the above, 'prop' should be contextually typed as 'string' from the
signature of 'hasOwnProperty' in the global 'Object' type.

However, in the case of string literal types, we don't want to get the
apparent type after fetching the contextual type. This is because the
apparent type of the '"onload"' string literal type is the global 'String'
type. This has adverse effects in simple assignments like the following:

    let x: "onload" = "onload";

In this example, the right-hand side of the assignment will grab the type
of 'x'. After figuring out the type is "onload", we then get the apparent
type which is 'String'. This is problematic because when we then check the
assignment itself, 'String's are not assignable to '"onload"'s.

So in this case, we grab the contextual type *without* getting its
apparent type.
2015-10-02 16:05:32 -07:00
Daniel Rosenwasser
f721971063 Capture compatible contextual types for unions containing string literals. 2015-10-02 15:41:12 -07:00
Daniel Rosenwasser
a3e7ccb108 Use normalized text for text on string literal types. 2015-10-02 15:00:46 -07:00
Daniel Rosenwasser
dc0e368f82 Make string literals valid types in type lists. 2015-10-01 16:45:48 -07:00
Daniel Rosenwasser
191be4f8fe Make string literals valid constituent types nodes in the parser. 2015-10-01 15:55:36 -07:00
Daniel Rosenwasser
d9559d58ca Merge branch 'grabParamsFromInitializers' 2015-09-25 17:11:33 -07:00
Daniel Rosenwasser
2692cde712 :%s/apst/apt 2015-09-25 17:10:58 -07:00
Daniel Rosenwasser
6bfc28f883 Try to grab parameters for single-declaration variable statements.
We only do this for a (parenthesized) function expression, arrow function,
or class expression with a constructor.

In the presence of a class expression, if there are multiple constructor
declarations, the parameters are acquired from the first one.
2015-09-25 16:30:26 -07:00
Daniel Rosenwasser
0ab9536f73 Merge pull request #4978 from Microsoft/expandDocTemplateCoverage
Expand JSDoc template generation locations (to 'master')
2015-09-25 15:28:28 -07:00
Daniel Rosenwasser
a458d4b2f4 Amended comments. 2015-09-25 13:59:47 -07:00
Vladimir Matveev
b866781609 Merge pull request #4946 from Microsoft/constInitializersInEnums
align behavior of constant expressions in initializers of ambient enu…
2015-09-24 21:49:35 -07:00
Daniel Rosenwasser
81dabb4d51 Ensure that doc comments don't appear between dotted names.
Also updated TODO
2015-09-24 17:11:05 -07:00
Daniel Rosenwasser
67b44b59c0 Add JSDoc to methods, constructors, classes, and namespace/module declarations. 2015-09-24 16:40:13 -07:00
Daniel Rosenwasser
1545ab56f3 Use a loop because reduce is unreadable. 2015-09-24 16:01:47 -07:00
Anders Hejlsberg
bcea3594a3 Merge pull request #4956 from Microsoft/bindingElementContextualTyping
Fix parameter destructuring issues
2015-09-24 15:55:37 -07:00
Anders Hejlsberg
1a26789615 Properly propagate contextual types into parameter destructuring elements 2015-09-24 13:35:12 -07:00
Wesley Wigham
dd660dca39 Merge pull request #4811 from weswigham/es6-module-type
Support modules when targeting ES6 and an ES6 ModuleKind
2015-09-24 12:09:58 -07:00
Vladimir Matveev
fa3d9f3997 align behavior of constant expressions in initializers of ambient enum members with spec 2015-09-23 21:30:27 -07:00
Anders Hejlsberg
a292da593b Check if binding element already has been assigned a contextual type 2015-09-23 14:45:09 -07:00
Vladimir Matveev
5a77d67b63 Merge pull request #4921 from Microsoft/implementsAsIdentifier
disambiguate: 'implements' starts heritage clause vs 'implements' is …
2015-09-22 09:13:37 -07:00
Vladimir Matveev
c56b4165ec disambiguate: 'implements' starts heritage clause vs 'implements' is a class name 2015-09-21 22:22:25 -07:00
Vladimir Matveev
2f7556256a removed duplicate function implementation 2015-09-21 21:30:10 -07:00
Wesley Wigham
8ff551ce08 merge with master 2015-09-21 17:38:56 -07:00
Wesley Wigham
d409ba785c Delete generated file, add to gitignore 2015-09-21 16:58:45 -07:00
Daniel Rosenwasser
c2f46c3ad9 Merge pull request #4886 from Microsoft/diagnosticDuplicateCodes
Fix duplicate codes in diagnostics
2015-09-21 15:40:30 -07:00
Mohamed Hegazy
45d96a18ac Merge branch 'fix-capitalization' of https://github.com/punya/TypeScript into punya-fix-capitalization 2015-09-21 02:00:58 -07:00
Daniel Rosenwasser
942ca46637 Fixed duplicate diagnostic codes. 2015-09-20 12:16:56 -07:00
Daniel Rosenwasser
92f5f59a07 Merge pull request #4875 from jbondc/utilities-typos
Utilities typos + missing reference
2015-09-19 10:04:41 -07:00
jbondc
921adc89e8 Utilities typos + missing reference 2015-09-19 11:43:15 -04:00
Daniel Rosenwasser
f88f029fdf Merge pull request #4862 from Microsoft/contextuallyTypeMethodDeclarations
Contextually type method declaration parameters in object literals
2015-09-18 12:34:40 -07:00
Daniel Rosenwasser
254af55204 Added missing predicate for contextual types of parameters. 2015-09-18 12:22:57 -07:00
Daniel Rosenwasser
2aa97bd1b9 Use custom type guard. 2015-09-18 12:22:52 -07:00
Wesley Wigham
04b0aa269f s/var/let 2015-09-18 10:29:54 -07:00
Punya Biswal
55218d64a5 Fix capitalization of minimumintegerDigits 2015-09-18 08:42:42 -04:00
Mohamed Hegazy
98db640a2c Fix documentation 2015-09-17 16:14:46 -07:00
Mohamed Hegazy
6969986bf0 Use intersection types in Object.assing defintion 2015-09-17 16:14:39 -07:00
Wesley Wigham
8d6cb5fbb5 Feedback from PR 2015-09-17 13:26:04 -07:00
Wesley Wigham
f2b901a3c7 reverts 60a120f, reexposes es6 option 2015-09-17 13:14:31 -07:00
Wesley Wigham
f3062c59fd style nits 2015-09-17 13:03:47 -07:00
Wesley Wigham
5dfca610f9 When targeting ES3 emit default alias as indexer 2015-09-16 17:33:49 -07:00
Wesley Wigham
75a5c2229c Fix import/export assignment checks to look at module kind rather than language version 2015-09-16 11:24:41 -07:00
Wesley Wigham
60a120f22a remove es6 as option from command line 2015-09-16 11:08:03 -07:00
Daniel Rosenwasser
c9170b81a8 Merge pull request #4815 from basarat/patch-1
fix types : export the base as children are exported
2015-09-15 20:42:19 -07:00
Basarat Ali Syed
32048ca5ac fix types : export the base as children are exported 2015-09-16 10:57:54 +10:00
Mohamed Hegazy
5b5d876cc2 more code review comments 2015-09-15 17:47:50 -07:00
Mohamed Hegazy
a93ab613fe Merge branch 'master' into iocaptureFixes 2015-09-15 17:41:34 -07:00
Wesley Wigham
48ba708e5e Add es6 module kind, stop using script version to infer it 2015-09-15 15:36:37 -07:00
Daniel Rosenwasser
45ecce4710 Merge pull request #4809 from Microsoft/mergeFromRelease1.6
Merge from release-1.6
2015-09-15 15:16:44 -07:00
Daniel Rosenwasser
00dcb57e3b Bump version back to 1.7.0. 2015-09-15 15:08:48 -07:00
Daniel Rosenwasser
38b605ea7d Merge branch 'release-1.6'
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/program.ts
	tests/baselines/reference/emptyObjectBindingPatternParameter04.symbols
	tests/baselines/reference/emptyObjectBindingPatternParameter04.types
	tests/baselines/reference/nodeResolution5.errors.txt
	tests/baselines/reference/nodeResolution7.errors.txt
2015-09-15 13:36:08 -07:00