diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7e6cb97a9302e..42c917234ebff 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20284,11 +20284,20 @@ namespace ts { // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts). const func = parent.parent; - return [ - createSyntheticExpression(expr, parent.parent.kind === SyntaxKind.Constructor ? getTypeOfSymbol(getSymbolOfNode(func)) : errorType), - createSyntheticExpression(expr, anyType), - createSyntheticExpression(expr, numberType) - ]; + if (func.kind === SyntaxKind.Constructor) { + return [ + createSyntheticExpression(expr, getTypeOfSymbol(getSymbolOfNode(func.parent))), + createSyntheticExpression(expr, undefinedType), + createSyntheticExpression(expr, getLiteralType(func.parameters.indexOf(parent))) + ]; + } + else { + return [ + createSyntheticExpression(expr, getParentTypeOfClassElement(func)), + createSyntheticExpression(expr, getClassElementPropertyKeyType(func)), + createSyntheticExpression(expr, getLiteralType(func.parameters.indexOf(parent))) + ]; + } case SyntaxKind.PropertyDeclaration: case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: