Skip to content

Modifier with only optional args resolves into never when bound with modifier keyword #886

Open
@mogstad

Description

@mogstad

When using the modifier keyword, and binding an all optional modifier the resolved type isn’t invokable.

Repro:

type Signature = {
  Args: {
    Named: {
      value?: string;
    };
  };
};

declare let Modifier: ModifierLike<Signature>;

<template>
  {{#let (modifier Modifier value='anything') as |aModifier|}}
    <div {{aModifier}}></div>
  {{/let}}
</template>

aModifier resolves to Invokable<(named: PrebindArgs<HTMLDivElement, never>) => ModifierReturn> when the argument isn’t option the type is: Invokable<(element: Element, named?: PrebindArgs<{ value: string; }, "value"> | undefined) => ModifierReturn>

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