JS static prop assignments don't need same type
Don't issue a "multiple declarations must have the same type" error for JS static property assignments, because these don't appear to have a type in this case.
This commit is contained in:
parent
61fe04ba0d
commit
341e7029eb
|
@ -21462,6 +21462,10 @@ namespace ts {
|
|||
}
|
||||
|
||||
function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration: Declaration, firstType: Type, nextDeclaration: Declaration, nextType: Type): void {
|
||||
if (isIdentifier(firstDeclaration) || isIdentifier(nextDeclaration)) {
|
||||
// js static assignment declarations don't have a type, so don't have to be consistent
|
||||
return;
|
||||
}
|
||||
const firstSourceFile = getSourceFileOfNode(firstDeclaration);
|
||||
const firstSpan = getErrorSpanForNode(firstSourceFile, getNameOfDeclaration(firstDeclaration) || firstDeclaration);
|
||||
const firstLocation = getLineAndCharacterOfPosition(firstSourceFile, firstSpan.start);
|
||||
|
|
Loading…
Reference in a new issue