@@ -5668,6 +5668,8 @@ module ts {
5668
5668
// when checking exported function declarations across modules check only duplicate implementations
5669
5669
// names and consistency of modifiers are verified when we check local symbol
5670
5670
var isExportSymbolInsideModule = symbol . parent && symbol . parent . flags & SymbolFlags . Module ;
5671
+ var duplicateFunctionDeclaration = false ;
5672
+ var multipleConstructorImplemenation = false ;
5671
5673
for ( var i = 0 ; i < declarations . length ; i ++ ) {
5672
5674
var node = < FunctionDeclaration > declarations [ i ] ;
5673
5675
var inAmbientContext = isInAmbientContext ( node ) ;
@@ -5690,10 +5692,10 @@ module ts {
5690
5692
5691
5693
if ( node . body && bodyDeclaration ) {
5692
5694
if ( isConstructor ) {
5693
- error ( node , Diagnostics . Multiple_constructor_implementations_are_not_allowed ) ;
5695
+ multipleConstructorImplemenation = true ;
5694
5696
}
5695
5697
else {
5696
- error ( node , Diagnostics . Duplicate_function_implementation ) ;
5698
+ duplicateFunctionDeclaration = true ;
5697
5699
}
5698
5700
}
5699
5701
else if ( ! isExportSymbolInsideModule && previousDeclaration && previousDeclaration . parent === node . parent && previousDeclaration . end !== node . pos ) {
@@ -5717,6 +5719,18 @@ module ts {
5717
5719
}
5718
5720
}
5719
5721
5722
+ if ( multipleConstructorImplemenation ) {
5723
+ forEach ( declarations , declaration => {
5724
+ error ( declaration , Diagnostics . Multiple_constructor_implementations_are_not_allowed ) ;
5725
+ } ) ;
5726
+ }
5727
+
5728
+ if ( duplicateFunctionDeclaration ) {
5729
+ forEach ( declarations , declaration => {
5730
+ error ( declaration , Diagnostics . Duplicate_function_implementation ) ;
5731
+ } ) ;
5732
+ }
5733
+
5720
5734
if ( ! isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && ! lastSeenNonAmbientDeclaration . body ) {
5721
5735
reportImplementationExpectedError ( lastSeenNonAmbientDeclaration ) ;
5722
5736
}
0 commit comments