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

Mu expressions can miss type checking errors #643

Closed
nickbattle opened this issue Sep 11, 2017 · 1 comment
Closed

Mu expressions can miss type checking errors #643

nickbattle opened this issue Sep 11, 2017 · 1 comment
Labels
bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release
Milestone

Comments

@nickbattle
Copy link
Contributor

The following spec does not report any TC errors in 2.5.2:

types
	ReceiptLine :: field : nat;

functions
	receiptLines: () -> ReceiptLine
	receiptLines() ==
		let rlines = if true then [ mk_ReceiptLine(1) ] else [] in
			mu(rlines(1), field |-> wibble);

However, "wibble" is undefined. The reason for this is that the conditional creation of "rlines" means that its type is "seq of ReceiptLine" or "seq of ?", and so its elements are ReceiptLine or ?. The presence of the unknown "?" is causing the mu operator to skimp on the type checking, missing the undefined variable - which should be an error, even if we don't know anything about the record type.

@nickbattle
Copy link
Contributor Author

Now fixed in ncb/development.

@nickbattle nickbattle added bug Incorrect behaviour of the tool Mergable A fix is available on a branch to merge for release labels Sep 11, 2017
@peterwvj peterwvj added this to the v2.5.4 milestone Sep 11, 2017
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