Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type Inference should be able to resolve a TVTA to a StructOrProcDef #4338

Open
Labels
dslxDSLX (domain specific language) implementation / front-end dslx:TIv2Bugs related to Type Inference v2

Description

Describe the bug
Currently, in PopulateTableVisitor::HandleStructInstanceInternal, we call GetStructOrProcRef and error out if the type annotation is anything other than a TypeRefTypeAnnotation. It should be possible to use a TypeVariableTypeAnnotation that eventually resolves to a struct or proc def in these cases. PR 4304 introduces a workaround for the case of struct types referenced in lambdas where the TRTA is included as the definer for the TVTA to allow retrieval while populating the table. This workaround is not ideal for a couple reasons:

  • This usage of the definer is unintuitive message passing from one piece of code to another.
  • It can't be round tripped or replicated by a user writing the longhand form of the lambda.

To Reproduce
Not currently reproducible due since struct instances can't be instantiated as generic types and returns a parser error (see second bullet point above), but supporting generic type struct instantiation will likely require a solution to this issue as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dslxDSLX (domain specific language) implementation / front-end dslx:TIv2Bugs related to Type Inference v2

    Type

    No fields configured for Bug.

    Projects

    Status
    No status

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /