Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b8082ca
Clean up jsdoc in utilities
sandersn Nov 11, 2016
641948f
Test assignability checking of object rests
sandersn Nov 16, 2016
074014e
Check assignability: rest destructuring assignment
sandersn Nov 16, 2016
eaf2f6c
Merge branch 'master' into getJSDoc-cleanup
sandersn Nov 16, 2016
3e52f3d
Codegen: Do not subtract 0 in arguments to rest array loop
subzey Nov 17, 2016
ad9ad8f
Clean up getJSDocTypeForVariableLikeDeclarationFromJSDocComment
sandersn Nov 17, 2016
5a05b94
Clean up getJSDocs
sandersn Nov 17, 2016
ddffe20
Clean up getJSDocParameterTag
sandersn Nov 17, 2016
a2b13d0
pass project name as a constructor parameter (#12333)
vladima Nov 17, 2016
e81cfa1
Clean cache code and streamline other code
sandersn Nov 17, 2016
9fec775
Merge pull request #12217 from subzey/feature/rest-loop-index
mhegazy Nov 18, 2016
2646828
Type relations for generic mapped types
ahejlsberg Nov 18, 2016
63387bb
Error on circular constraints in mapped types
ahejlsberg Nov 18, 2016
79bdc26
Accept new baselines
ahejlsberg Nov 18, 2016
075a3eb
Add new tests
ahejlsberg Nov 18, 2016
aa0d2ce
Make "exclude" default to empty if "include" is present.
Nov 18, 2016
cbde25f
Handle the scenario when heritage clause of interface is not entity n…
sheetalkamat Nov 18, 2016
2376e30
Support apparent types for T[K] indexed access types
ahejlsberg Nov 18, 2016
a789990
Add tests
ahejlsberg Nov 18, 2016
9945529
use location of config file as initial location for automatic type re…
vladima Nov 18, 2016
8674d92
Disable evolving types with implicit any
sandersn Nov 18, 2016
a4d584f
Update baselines to have no evolving types
sandersn Nov 18, 2016
aa55650
Handle when type alias's type parameter extends type that wont get em…
sheetalkamat Nov 18, 2016
e81da9c
Merge pull request #12351 from Microsoft/mappedTypeRelations
ahejlsberg Nov 18, 2016
7750fe1
Always enable evolving types in Javascript files
sandersn Nov 18, 2016
f626ff7
Merge pull request #12363 from Microsoft/declarationsInFilesWithErrors
sheetalkamat Nov 18, 2016
ab84cd0
Improve readability of types and names
sandersn Nov 18, 2016
7caee79
Rename getJSDocComments -> getCommentsFromJSDoc
sandersn Nov 18, 2016
b514d7c
Merge pull request #12362 from Microsoft/disable-evolving-types-with-…
sandersn Nov 18, 2016
91e6bce
Address PR comments
sandersn Nov 18, 2016
0c5429d
Add missed jsDoc rename in services' Node implementation
sandersn Nov 18, 2016
71b28a0
Merge pull request #12310 from Microsoft/check-object-rest-destructur…
sandersn Nov 19, 2016
eaf791e
update to tslint@next
vladima Nov 19, 2016
c96bc89
Fix issue #12260.
andraaspar Nov 19, 2016
dcd225a
Fix comparable relation for keyof T
ahejlsberg Nov 19, 2016
f2a7434
Merge pull request #12376 from Microsoft/vladima/update-tslint
vladima Nov 19, 2016
a439e62
Add tests
ahejlsberg Nov 19, 2016
4ce494a
Accept new baselines
ahejlsberg Nov 19, 2016
f8b8465
Merge pull request #12378 from andraaspar/master
mhegazy Nov 20, 2016
998246a
Merge pull request #12389 from Microsoft/keyofRelations
ahejlsberg Nov 20, 2016
110c3ac
Add locale options to tsserver (#12369)
Nov 21, 2016
7c1f33f
Fix lint errors
Nov 21, 2016
baa228b
Merge pull request #12415 from Microsoft/fix_lint
Nov 21, 2016
4092531
Merge pull request #12335 from Microsoft/getJSDoc-cleanup
sandersn Nov 21, 2016
b060107
recompute character to column when comparing indentations (#12375)
vladima Nov 21, 2016
76ceab9
Make keyof T a string-like type
ahejlsberg Nov 21, 2016
854a20f
Update Record<K, T> type
ahejlsberg Nov 21, 2016
5498a95
Update tests
ahejlsberg Nov 21, 2016
c555848
Accept new baselines
ahejlsberg Nov 21, 2016
90ee161
Merge pull request #12350 from Microsoft/default_excludes
Nov 21, 2016
4c6b94f
wrap subexpressions of conditional expressions in parens if necessary…
vladima Nov 21, 2016
1710df5
Type of for-in variable is keyof T when object type is a type parameter
ahejlsberg Nov 21, 2016
dbc661f
Accept new baselines
ahejlsberg Nov 21, 2016
b662a8b
Add test case
ahejlsberg Nov 21, 2016
77c0540
Merge pull request #12425 from Microsoft/keyofOnlyStrings
ahejlsberg Nov 21, 2016
9009da2
Update baseline-accept configuration
mhegazy Nov 22, 2016
843d08b
increase timeout
mhegazy Nov 22, 2016
5403ce6
normalize path in harness
mhegazy Nov 22, 2016
b8b6e61
handel missing files gracefully
mhegazy Nov 22, 2016
2d16b19
Merge pull request #12431 from Microsoft/rwcFixes
mhegazy Nov 22, 2016
7e8af62
Merge branch 'master' into release-2.1
mhegazy Nov 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests
  • Loading branch information
ahejlsberg committed Nov 19, 2016
commit a439e6213883a310bbeefb7cac7777f4cff6f04c
40 changes: 40 additions & 0 deletions tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,46 @@ function f40(c: C) {
let z: Z = c["z"];
}

function f50<T>(k: keyof T, s: string, n: number) {
const x1 = s as keyof T;
const x2 = n as keyof T;
const x3 = k as string;
const x4 = k as number;
const x5 = k as string | number;
}

function f51<T, K extends keyof T>(k: K, s: string, n: number) {
const x1 = s as keyof T;
const x2 = n as keyof T;
const x3 = k as string;
const x4 = k as number;
const x5 = k as string | number;
}

function f52<T>(obj: { [x: string]: boolean }, k: keyof T, s: string, n: number) {
const x1 = obj[s];
const x2 = obj[n];
const x3 = obj[k];
}

function f53<T, K extends keyof T>(obj: { [x: string]: boolean }, k: K, s: string, n: number) {
const x1 = obj[s];
const x2 = obj[n];
const x3 = obj[k];
}

function f54<T>(obj: T, key: keyof T) {
for (let s in obj[key]) {
}
const b = "foo" in obj[key];
}

function f55<T, K extends keyof T>(obj: T, key: K) {
for (let s in obj[key]) {
}
const b = "foo" in obj[key];
}

// Repros from #12011

class Base {
Expand Down