Skip to content

Instantiate templates that contain only optional arguments when assigning template member #7123

@chrisradek

Description

@chrisradek

Consider this example:

model M1<T = string> {
  bar: T;
}

model A {
  bar: M1.bar;
}

Model M1 has a default template argument: T = string.
I would expect that the type of A.bar would thus be string, as we're assigning M1.bar which is a template parameter that has a default type.

This is also a problem when referencing an operation inside an interface e.g.:

interface Foo<T = string> {
  op foo(): T;
}
op bar is Foo.foo;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions