Skip to content

Allow type variables with do syntax #54915

@PatrickHaecker

Description

@PatrickHaecker

The do syntax should support type variables, so that something like

myfunction(bound_parameter) do free_parameter::T where T
    # T should be available here
end

or at least

myfunction(bound_parameter) do (free_parameter::T) where T
    # T should be available here
end

should behave the same as in regular functions regarding T .

There are three reasons why the do syntax should allow type variables:

  • To support multiple dispatch in case of multiple method definitions
  • To support cases where the type is used statically
  • For consistency reasons: Ideally each way of defining functions should support all functionality

This is discussed in a Question and a Suggestion. A change proposal is already provided by sgaure (without pull request).

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions