Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Proposal: QualifiedMethods #991

@iskiselev

Description

@iskiselev

Based on my work on #988 and thoughts on #185, #623 I'd like to propose next:
Let's introduce QualifiedMethod. Qaulified method will

  • store type reference and method name. It may also contain method signature
  • extend function so on call will invoke target method either through signature or runtime dispatcher:
    • for instance method will accept this reference and return function, that
    • for generic methods will accept generic arguments and return function, that
    • will accept method arguments and call target method
  • have Call method, that will accept this reference, generic argumetns and method arguments in single call for perfomance-optimised calls
  • have Of method, that will accept same arguments, as MethodSignature and return QualifiedMethod with stored MethodSignature.
  • be stored in type public interface for static methods (same as now stored static method invocators, but they will be fully compatible) and inside $InstanceMethod property of type public interface for instance method (here they will replace InterfaceMethods that currently stored in type public interface). EDITED: If there is no overrides for method in type, it will store method signature, otherwise not.

Such organisation will allow us later solve #185, #623, #990 and provide statically-typed way to call any method with specified signature from TypeScript code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions