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: DafnyOptions.O.Compiler is null, preventing instantiation of ModuleExportDecl #1933

Merged
merged 10 commits into from
Mar 31, 2022

Conversation

MikaelMayer
Copy link
Member

Fixes #1932

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

@MikaelMayer MikaelMayer self-assigned this Mar 24, 2022
@MikaelMayer MikaelMayer requested a review from cpitclaudel March 24, 2022 14:18
Copy link
Member

@cpitclaudel cpitclaudel left a comment

Choose a reason for hiding this comment

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

I don't think this is the right fix: we should make sure that the compiler is properly instantiated.

EnclosingModuleDefinition.CompileName, CompileName);
} else {
return Declaration.IdProtect(EnclosingModuleDefinition.CompileName) + "." + Declaration.IdProtect(CompileName);
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we not instantiate the compiler?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the AST is the right place to instantiate a compiler anyway, it should be instantiated in the options if really instantiated manually. I we don't want the compiler to be null, I think we should always instantiate a default C# compiler. Would you prefer that?

RELEASE_NOTES.md Outdated
@@ -1,7 +1,8 @@
# Upcoming

- fix: Miscompilation due to incorrect parenthesization in C# output for casts. (#1908)
- fix: Miscompilation due to incorrect parenthesization in C# output for casts. (https://github.com/dafny-lang/dafny/pull/1908)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you add the full link?

Copy link
Member Author

Choose a reason for hiding this comment

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

So that it's browsable when reading the README.md from a text editor, and in Github markdown it still displays nicely "#1908"

@MikaelMayer MikaelMayer requested a review from cpitclaudel March 29, 2022 17:16
@cpitclaudel
Copy link
Member

cpitclaudel commented Mar 29, 2022

Could you have a look at #1945 ? I don't think defaulting to the C# compiler is the right fix.

cpitclaudel
cpitclaudel previously approved these changes Mar 30, 2022
@cpitclaudel
Copy link
Member

Can you fix the conflicts in RELEASE_NOTES?

@MikaelMayer MikaelMayer merged commit 9637843 into master Mar 31, 2022
@MikaelMayer MikaelMayer deleted the fix-1932-compiler-null branch March 31, 2022 16:20
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.

Bug: Using Dafny.dll to build an AST fails if no compiler specified.
2 participants