Skip to content

Change generated code to use explicit types #187

@eernstg

Description

@eernstg

Reflectable currently generates code that uses the parameter type dynamic in a number of generated function literals, even though they are stored in the reflectable "database" and will be used in a type specific manner: A function literal that enables reflective invocation of foo on an instance of Foo may have the form (o) => o.foo, but it could be (Foo o) => o.foo.

Using explicit types will be much more friendly to static analysis, and in particular to tree-shaking, because it is then known at compile-time that this function literal body won't access any other members named foo than the one in Foo, which may allow some other members named foo to be eliminated from the compiled program.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions