Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

** operator type errors have wrong location information #649

Closed
peterwvj opened this issue Oct 11, 2017 · 4 comments
Closed

** operator type errors have wrong location information #649

peterwvj opened this issue Oct 11, 2017 · 4 comments
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Milestone

Comments

@peterwvj
Copy link
Member

peterwvj commented Oct 11, 2017

This issue can easily be demonstrated by type-checking the following class. The actual and expected error locations are marked using comments.

class A

operations

public static op : () ==> nat
op () ==
let a = 2,
    b = '2' -- Error reported here
      
in
  return a ** b; -- Expected error to be reported here

end A

VDMJ has the same problem.

@peterwvj peterwvj added the bug Incorrect behaviour of the tool label Oct 11, 2017
@peterwvj peterwvj added this to the v2.5.4 milestone Oct 11, 2017
@peterwvj peterwvj changed the title ** operator type errors has wrong location information ** operator type errors have wrong location information Oct 11, 2017
@nickbattle
Copy link
Contributor

OK, I'll take a look. It's usually a trivial thing, using the location of a definition rather than the location of an expression that uses that definition.

@peterwvj
Copy link
Member Author

Yeah, that's what I thought. Thanks!

@nickbattle nickbattle added the Mergable A fix is available on a branch to merge for release label Oct 11, 2017
@nickbattle
Copy link
Contributor

OK, fix now in ncb/development. As expected, just the wrong object's location being used.

@peterwvj
Copy link
Member Author

Sounds good, thanks Nick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Projects
None yet
Development

No branches or pull requests

2 participants