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

fix: Exclude type information for “new object” allocations #3450

Merged
merged 5 commits into from
Feb 3, 2023

Conversation

RustanLeino
Copy link
Collaborator

@RustanLeino RustanLeino commented Feb 2, 2023

Fixes #3449

This PR fixes the verifier so that it does not assume any specific dynamic type of the object allocated by new object. This is a special allocation that is supposed to allocate an object of an arbitrary type. (See section 14.1 of the reference manual.)

The PR also improves the source location reported when a program attempts new X where X is a non-class, non-object type.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@RustanLeino RustanLeino marked this pull request as ready for review February 2, 2023 22:26
@RustanLeino RustanLeino enabled auto-merge (squash) February 2, 2023 22:29
@jtristan jtristan self-requested a review February 3, 2023 02:30
Copy link
Collaborator

@davidcok davidcok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have put the error message on the type rather than on the new, but its fine on the new.

@RustanLeino RustanLeino merged commit 9b97489 into dafny-lang:master Feb 3, 2023
@RustanLeino RustanLeino deleted the issue-3449 branch February 3, 2023 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new object should give object of arbitrary type
3 participants