There is a function in the checker called shouldWriteTypeOfFunctionSymbol, which decides whether
a) a given type is a function type and
b) if so, it should be emitted using typeof, or expanded into its full form
The problem with this function is that it only uses typeof for static methods, global functions, and exported functions (the latter two it groups into "non local" functions). There is intuitively no reason to special case these. However, the danger with broadening the set of occurrences of typeof is that the declaration emitter will report privacy errors for all of these. We need to find a way to stop special casing these, while at the same time not reporting needless privacy errors.
There is a function in the checker called
shouldWriteTypeOfFunctionSymbol, which decides whethera) a given type is a function type and
b) if so, it should be emitted using
typeof, or expanded into its full formThe problem with this function is that it only uses typeof for static methods, global functions, and exported functions (the latter two it groups into "non local" functions). There is intuitively no reason to special case these. However, the danger with broadening the set of occurrences of typeof is that the declaration emitter will report privacy errors for all of these. We need to find a way to stop special casing these, while at the same time not reporting needless privacy errors.