mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-15 16:53:31 -06:00
Removes old type predicate functions
This commit is contained in:
parent
19e725636e
commit
e1f82c599b
@ -1358,7 +1358,7 @@ module ts {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
function getWriteResult<T>(data: T, enclosingDeclaration: Node, flags: TypeFormatFlags, method: (data: T, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags) => void) {
|
||||
let writer = getSingleLineStringWriter();
|
||||
method(data, writer, enclosingDeclaration, flags);
|
||||
@ -5670,11 +5670,6 @@ module ts {
|
||||
|
||||
return true;
|
||||
}
|
||||
if (expr.expression.kind === SyntaxKind.PropertyAccessExpression &&
|
||||
getSymbolAtLocation((<PropertyAccessExpression>expr.expression).expression) === symbol) {
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -10221,6 +10216,7 @@ module ts {
|
||||
let func = getContainingFunction(node);
|
||||
if (func) {
|
||||
let signature = getSignatureFromDeclaration(func);
|
||||
let returnType = getReturnTypeOfSignature(signature);
|
||||
let exprType = checkExpressionCached(node.expression);
|
||||
|
||||
if (func.asteriskToken) {
|
||||
@ -10231,7 +10227,6 @@ module ts {
|
||||
return;
|
||||
}
|
||||
|
||||
let returnType = getReturnTypeOfSignature(signature);
|
||||
if (func.kind === SyntaxKind.SetAccessor) {
|
||||
error(node.expression, Diagnostics.Setters_cannot_return_a_value);
|
||||
}
|
||||
@ -11292,10 +11287,6 @@ module ts {
|
||||
links.exportsChecked = true;
|
||||
}
|
||||
}
|
||||
|
||||
function checkTypePredicateNode(node: TypePredicateNode) {
|
||||
|
||||
}
|
||||
|
||||
function checkSourceElement(node: Node): void {
|
||||
if (!node) return;
|
||||
@ -11324,8 +11315,6 @@ module ts {
|
||||
return checkAccessorDeclaration(<AccessorDeclaration>node);
|
||||
case SyntaxKind.TypeReference:
|
||||
return checkTypeReferenceNode(<TypeReferenceNode>node);
|
||||
case SyntaxKind.TypePredicate:
|
||||
return checkTypePredicateNode(<TypePredicateNode>node);
|
||||
case SyntaxKind.TypeQuery:
|
||||
return checkTypeQuery(<TypeQueryNode>node);
|
||||
case SyntaxKind.TypeLiteral:
|
||||
|
||||
@ -2012,34 +2012,6 @@ module ts {
|
||||
return parseInitializer(/*inParameter*/ true);
|
||||
}
|
||||
|
||||
function parseTypePredicate(signature: SignatureDeclaration) {
|
||||
let node = <TypePredicateNode>createNode(SyntaxKind.TypePredicate);
|
||||
if (token !== SyntaxKind.ThisKeyword) {
|
||||
node.pos = signature.type.pos;
|
||||
node.parameterName = <Identifier>(<TypeReferenceNode>signature.type).typeName;
|
||||
signature.type = undefined;
|
||||
}
|
||||
else {
|
||||
// Swallow `this`
|
||||
nextToken();
|
||||
}
|
||||
|
||||
// Swallow `is`
|
||||
nextToken();
|
||||
|
||||
node.type = parseType();
|
||||
signature.typePredicate = finishNode(node);
|
||||
}
|
||||
|
||||
function parseTypePredicateOrReturnType(signature: SignatureDeclaration) {
|
||||
if (token === SyntaxKind.ThisKeyword) {
|
||||
parseTypePredicate(signature);
|
||||
}
|
||||
else {
|
||||
signature.type = parseType();
|
||||
}
|
||||
}
|
||||
|
||||
function fillSignature(
|
||||
returnToken: SyntaxKind,
|
||||
yieldAndGeneratorParameterContext: boolean,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user