Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b96f6cd
Union type instead of best common supertype for multiple return state…
ahejlsberg Sep 1, 2016
b5c2d5b
Accept new baselines
ahejlsberg Sep 1, 2016
a8063df
Always use literal types for literals
ahejlsberg Sep 1, 2016
adc015d
Always keep literal types and widen when inferred as types for mutabl…
ahejlsberg Sep 1, 2016
44e1096
Update tests
ahejlsberg Sep 1, 2016
33b8109
Accept new baselines (huge!)
ahejlsberg Sep 1, 2016
cf55bf9
Fix lint errors
ahejlsberg Sep 1, 2016
feeb204
Fix fourslash tests
ahejlsberg Sep 1, 2016
2a60f79
Remove failing fourslash tests (may need to be restored and fixed)
ahejlsberg Sep 1, 2016
b3c9571
Restrict widening of literal types in type argument inference
ahejlsberg Sep 2, 2016
6ae71cb
Readonly properties in classes are considered immutable locations
ahejlsberg Sep 2, 2016
b10f79b
Keep literal return types only when contextually typed by type contai…
ahejlsberg Sep 2, 2016
4b9b90a
Perform return type widening checks after union type is formed
ahejlsberg Sep 2, 2016
db230a2
Accept new baselines
ahejlsberg Sep 2, 2016
694705f
Removing old comment
ahejlsberg Sep 2, 2016
ff3b627
Less widening of literal types in type inference
ahejlsberg Sep 7, 2016
da2efa0
Accept new baselines
ahejlsberg Sep 7, 2016
2f9c9c9
Remove failing fourslash tests (may need to be restored and fixed)
ahejlsberg Sep 7, 2016
b33e499
Merge branch 'master' into literalTypesAlways
ahejlsberg Sep 7, 2016
ad1c9b9
Fix merge issue
ahejlsberg Sep 7, 2016
b9fa0af
Fixing the fix
ahejlsberg Sep 7, 2016
737867e
Accept new baselines
ahejlsberg Sep 7, 2016
31a94fc
Cleaning up InferenceContext
ahejlsberg Sep 7, 2016
6f06d06
Simplify tracking of top-level type inferences
ahejlsberg Sep 7, 2016
56c37ec
Merge branch 'master' into literalTypesAlways
mhegazy Sep 7, 2016
d6de3e1
Revert "Remove failing fourslash tests (may need to be restored and f…
mhegazy Sep 8, 2016
f73b4be
Revert "Remove failing fourslash tests (may need to be restored and f…
mhegazy Sep 8, 2016
05882ff
Merge branch 'useBaselinesForQuickInfoTests' into literalTypesAlways
mhegazy Sep 8, 2016
f13c16d
Fix tests
mhegazy Sep 8, 2016
dfb5091
Merge branch 'master' into literalTypesAlways
mhegazy Sep 8, 2016
090c2fe
Accept baselines after merge
mhegazy Sep 8, 2016
3ea1b79
Fix fourslash test
mhegazy Sep 8, 2016
aeb899a
Merge branch 'master' into literalTypesAlways
ahejlsberg Sep 11, 2016
a28c703
Accept new baselines
ahejlsberg Sep 11, 2016
2344a80
Handle const binding elements with initializers correctly
ahejlsberg Sep 11, 2016
ef81594
Add tests
ahejlsberg Sep 11, 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
Readonly properties in classes are considered immutable locations
  • Loading branch information
ahejlsberg committed Sep 2, 2016
commit 6ae71cb7eda51ba75c403d442c0e861a0e9d7864
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3086,7 +3086,7 @@ namespace ts {
// Use the type of the initializer expression if one is present
if (declaration.initializer) {
const exprType = checkExpressionCached(declaration.initializer);
const type = getCombinedNodeFlags(declaration) & NodeFlags.Const ? exprType : getBaseTypeOfLiteralType(exprType);
const type = getCombinedNodeFlags(declaration) & (NodeFlags.Const | NodeFlags.Readonly) ? exprType : getBaseTypeOfLiteralType(exprType);
return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
}

Expand Down