Added comments for fresh/regular unique symbol types

This commit is contained in:
Ron Buckton
2017-06-08 17:05:51 -07:00
parent 5854e87476
commit 3f83b55899

View File

@@ -4537,6 +4537,10 @@ namespace ts {
}
// If the type is a fresh, unique symbol type and is not the type for this symbol, get its regular type
// For example:
//
// const x = Symbol(); // fresh type, e.g. 'symbol()'
// const y = x; // regular type, e.g. 'typeof x'
if (type.flags & TypeFlags.Unique && type.flags & TypeFlags.Fresh && type.symbol !== symbol) {
type = (<UniqueType>type).regularType;
}