@@ -2,10 +2,10 @@ import * as ts from "typescript";
22import { getOrUpdate } from "../../utils" ;
33import { TransformationContext } from "../context" ;
44import {
5- UnsupportedNoSelfFunctionConversion ,
6- UnsupportedOverloadAssignment ,
7- UnsupportedSelfFunctionConversion ,
8- } from "./errors " ;
5+ unsupportedNoSelfFunctionConversion ,
6+ unsupportedOverloadAssignment ,
7+ unsupportedSelfFunctionConversion ,
8+ } from "./diagnostics " ;
99import { ContextType , getFunctionContextType } from "./function-context" ;
1010
1111// TODO: Clear if types are reused between compilations
@@ -97,12 +97,12 @@ function validateFunctionAssignment(
9797 const toContext = getFunctionContextType ( context , toType ) ;
9898
9999 if ( fromContext === ContextType . Mixed || toContext === ContextType . Mixed ) {
100- throw UnsupportedOverloadAssignment ( node , toName ) ;
100+ context . diagnostics . push ( unsupportedOverloadAssignment ( node , toName ) ) ;
101101 } else if ( fromContext !== toContext && fromContext !== ContextType . None && toContext !== ContextType . None ) {
102102 if ( toContext === ContextType . Void ) {
103- throw UnsupportedNoSelfFunctionConversion ( node , toName ) ;
103+ context . diagnostics . push ( unsupportedNoSelfFunctionConversion ( node , toName ) ) ;
104104 } else {
105- throw UnsupportedSelfFunctionConversion ( node , toName ) ;
105+ context . diagnostics . push ( unsupportedSelfFunctionConversion ( node , toName ) ) ;
106106 }
107107 }
108108}
0 commit comments