@@ -695,8 +695,9 @@ export class Compiler extends DiagnosticEmitter {
695695
696696 // traverse instances
697697 case ElementKind . FUNCTION_PROTOTYPE : {
698- let functionInstances = ( < FunctionPrototype > element ) . instances ;
699- if ( functionInstances ) {
698+ let functionPrototype = < FunctionPrototype > element ;
699+ let functionInstances = functionPrototype . instances ;
700+ if ( functionInstances !== null && functionInstances . size > 0 ) {
700701 // TODO: for (let instance of instances.values()) {
701702 for ( let _values = Map_values ( functionInstances ) , i = 0 , k = _values . length ; i < k ; ++ i ) {
702703 let instance = unchecked ( _values [ i ] ) ;
@@ -707,12 +708,18 @@ export class Compiler extends DiagnosticEmitter {
707708 }
708709 this . ensureModuleExport ( instanceName , instance , prefix ) ;
709710 }
711+ } else if ( functionPrototype . is ( CommonFlags . GENERIC ) ) {
712+ this . warning (
713+ DiagnosticCode . Exported_generic_function_or_class_has_no_concrete_instances ,
714+ functionPrototype . identifierNode . range
715+ ) ;
710716 }
711717 break ;
712718 }
713719 case ElementKind . CLASS_PROTOTYPE : {
714- let classInstances = ( < ClassPrototype > element ) . instances ;
715- if ( classInstances ) {
720+ let classPrototype = < ClassPrototype > element ;
721+ let classInstances = classPrototype . instances ;
722+ if ( classInstances !== null && classInstances . size > 0 ) {
716723 // TODO: for (let instance of instances.values()) {
717724 for ( let _values = Map_values ( classInstances ) , i = 0 , k = _values . length ; i < k ; ++ i ) {
718725 let instance = unchecked ( _values [ i ] ) ;
@@ -723,6 +730,11 @@ export class Compiler extends DiagnosticEmitter {
723730 }
724731 this . ensureModuleExport ( instanceName , instance , prefix ) ;
725732 }
733+ } else if ( classPrototype . is ( CommonFlags . GENERIC ) ) {
734+ this . warning (
735+ DiagnosticCode . Exported_generic_function_or_class_has_no_concrete_instances ,
736+ classPrototype . identifierNode . range
737+ ) ;
726738 }
727739 break ;
728740 }
0 commit comments