Skip to content

Unable to refer to component implementation in same file #34

@joeseibel

Description

@joeseibel

When a verification plan refers to a component implementation in the same file, the reference is not resolvable. In the following example, the reference to SimplePlan::s.i cannot be resolved:

package SimplePlan
public
  annex contract {**
    verification plan simplePlan {
      component s: SimplePlan::s.i;
    }
  **};

  system s
  end s;

  system implementation s.i
    annex contract {**
      verify SimplePlan::simplePlan;
    **};
  end s.i;
end SimplePlan;

I did a little investigating and found that the issue is related to the method ContractImportedNamespaceAwareLocalScopeProvider.getAllDescriptions(Resource) which overrides ImportedNamespaceAwareLocalScopeProvider.getAllDescriptions(Resource). If I remove the override, then the reference becomes resolvable.

Unfortunately, I can't remember the reason why this override with the contract specific cache key was added. I seem to remember that it had something to do with getting cross references to work for files that contain both EMV2 and the contract annex, but I can't remember the details.

We should experiment and figure out why the custom cache key was added in the first place and then make local file references from contract to AADL work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions