Skip to content

Add support for functions with open generics in CLR type plugins #18

@lsiddiquee

Description

@lsiddiquee

Overview

This issue proposes adding support for functions with open generics in the SemanticPluginForge. Currently, all functions with open generics are ignored when creating a plugin from CLR types.

Current Limitation

When creating a plugin from CLR types, functions with open generic parameters are not supported and are simply ignored in the current implementation. This limits the functionality that can be exposed through the plugin system.

Proposed Solution

We can extend the FunctionMetadata class with optional type parameters which can be used to close the open generic. This would allow us to:

  1. Properly recognize functions with open generics during plugin creation from CLR types
  2. Create concrete implementations when these functions are needed

Implementation Details

  1. Modify the FunctionMetadata class to include optional type parameters
  2. Update the plugin creation process to identify and include functions with open generics
  3. Add logic to handle the closure of open generics at runtime
  4. Implement a mechanism to use the concrete method once the generic type has been specified
  5. Update relevant documentation to reflect these changes

Benefits

  • Support for a broader range of function signatures in CLR types
  • Increased flexibility in function definitions
  • Better type safety across the plugin system
  • More complete mapping of CLR type functionality to plugin functions

Acceptance Criteria

  • Plugin creation from CLR types can identify functions with open generics
  • FunctionMetadata can represent functions with open generic parameters
  • Open generics can be properly closed at runtime
  • Concrete methods can be correctly invoked
  • Tests added to verify the functionality
  • Documentation updated

Technical Notes

This will require changes to the CLR type inspection process and the core function registration and invocation pipeline to properly handle the type information throughout the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions