Merge pull request #12366 from Microsoft/declarationsInFilesWithErrors

[Release 2.1] Fixes for #12291 and #12326: Declaration emit when there are errors in the source file
This commit is contained in:
Sheetal Nandi
2016-11-18 15:46:58 -08:00
committed by GitHub
8 changed files with 62 additions and 1 deletions

View File

@@ -1037,6 +1037,10 @@ namespace ts {
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;
break;
case SyntaxKind.TypeAliasDeclaration:
diagnosticMessage = Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;
break;
default:
Debug.fail("This is unknown parent for type parameter: " + node.parent.kind);
}
@@ -1143,7 +1147,10 @@ namespace ts {
const prevEnclosingDeclaration = enclosingDeclaration;
enclosingDeclaration = node;
emitTypeParameters(node.typeParameters);
emitHeritageClause(getInterfaceBaseTypeNodes(node), /*isImplementsList*/ false);
const interfaceExtendsTypes = filter(getInterfaceBaseTypeNodes(node), base => isEntityNameExpression(base.expression));
if (interfaceExtendsTypes && interfaceExtendsTypes.length) {
emitHeritageClause(interfaceExtendsTypes, /*isImplementsList*/ false);
}
write(" {");
writeLine();
increaseIndent();

View File

@@ -2276,6 +2276,10 @@
"category": "Error",
"code": 4082
},
"Type parameter '{0}' of exported type alias has or is using private name '{1}'.": {
"category": "Error",
"code": 4083
},
"Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict.": {
"category": "Message",
"code": 4090