Skip to content

Generalize the rule for when function types get serialized using "typeof" #559

@JsonFreeman

Description

@JsonFreeman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions