demo/typescript.js
function checkTypeAnnotationAsExpression(node) {
            switch (node.kind) {
                case 141 /* PropertyDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 138 /* Parameter */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 143 /* MethodDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 145 /* GetAccessor */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 146 /* SetAccessor */:
                    checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node));
                    break;
            }
        }
function checkTypeAnnotationAsExpression(node) {
            switch (node.kind) {
                case 141 /* PropertyDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 138 /* Parameter */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 143 /* MethodDeclaration */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 145 /* GetAccessor */:
                    checkTypeNodeAsExpression(node.type);
                    break;
                case 146 /* SetAccessor */:
                    checkTypeNodeAsExpression(ts.getSetAccessorTypeAnnotationNode(node));
                    break;
            }
        }
Checks the type annotation of an accessor declaration or property declaration as
an expression if it is a type reference to a type with a value declaration.