Skip to content

Wrong diagnostic on calls when editing a loaded dependency #1990

@fm-117

Description

@fm-117

We have to test this scenario:

2 programs:

  • PGM1 defines public type TypeA
  • PGM2 defines public procedure ProcA with at least one of its param of type PGM1::TypeA

Now load both programs as dependencies in LanguageServer and then open 'PGM1' as main program to edit it. If PGM1 contains a call to PGM2::ProcA, it will likely produce an error on call statement saying that the types don't match.

This is because we probably end with 2 distinct TypeDefinition instances for the same type PGM1::TypeA, one comes from the 'dependency load' (and is kept somehow), the second one comes from the 'edit load'.

TODO:

  1. test the scenario and confirm that 2 instances of TypeA are kept, also test what happens when its a type reference instead of a procedure (i.e. PGM2::TypeB uses PGM1::TypeA)
  2. possibles fixes
    a. ensure we always have one single instance for symbol definitions
    b. Change reference comparison into Equals call to avoid the error

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions