Skip to content

Late-shared method declarations are not correctly handled #136

@JonatanWaern

Description

@JonatanWaern

Reproducer:

template decl {
    shared method m();
}
template impl {
   method m() {}
}
is (decl, impl);

method p() {
   m();
}

This is allowed in DML, but incorrectly handled in DLS. It will report a non-fatal error and not correctly bind references around these method.
On m() call:
Goto-def goes nowhere (incorrect, should go to m declaration in impl)
Goto-decl goes to declaration in decl (correct)
Goto-impl goes nowhere (correct)
Goto-references goes to all calls to m() (correct)

On m() declaration in decl:
Goto-def goes to definition in impl (correct)
Goto-decl goes to definition in impl (incorrect, should go nowhere or back to the decl)
Goto-implementation goes nowhere (could be viewed as correct, could also go to definition in impl)
Goto-references goes nowhere (incorrect, should go to all calls to m())

On m() definition in impl:
Goto-def goes to definition in impl (correct)
Goto-decl goes to definition in impl (incorrect, should go declaration in decl)
Goto-impl goes nowhere (correct)
Goto-references goes to all calls to m() (correct)

Of note: behavior of similar case for un-related declaration/definition of parameters seem to work correctly

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions