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: Support for user-defined module fmt for all compilers #5441

Merged
merged 17 commits into from
May 17, 2024

Conversation

MikaelMayer
Copy link
Member

This PR fixes #5283
I added the corresponding test.

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

@fabiomadge
Copy link
Collaborator

Yes, this fixed the issue you opened, but the underlying problem still persists. Here's another problematic program.

module time {}

method Main(){
     print "done\n";
}

They are all reserved by the GO standard library. I would prefer to merge a more comprehensive fix.

@MikaelMayer MikaelMayer enabled auto-merge (squash) May 16, 2024 15:07
docs/dev/news/5283.fix Outdated Show resolved Hide resolved
Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs Outdated Show resolved Hide resolved
@@ -686,8 +686,11 @@ private class ClassWriter : IClassWriter {
}

private string FullName(TopLevelDecl decl) {
var localDefinition = decl.EnclosingModuleDefinition == enclosingModule;
return IdProtect(localDefinition ? decl.GetCompileName(Options) : decl.GetFullCompileName(Options));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I messed with this a little. Maybe you can have double check it.

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 know how to evaluate if this is good or not. I'll let the CI test this new behavior.

docs/dev/news/5283.fix Outdated Show resolved Hide resolved
MikaelMayer and others added 2 commits May 16, 2024 17:24
Co-authored-by: Fabio Madge <fmadge@amazon.com>
fabiomadge
fabiomadge previously approved these changes May 17, 2024
Copy link
Collaborator

@fabiomadge fabiomadge left a comment

Choose a reason for hiding this comment

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

Thanks!

@MikaelMayer MikaelMayer merged commit 9a7f992 into master May 17, 2024
21 checks passed
@MikaelMayer MikaelMayer deleted the fix-5283-reserved-keywords-go-need-of-escape branch May 17, 2024 16:59
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.

Reserved keywords in Go in need of escape
2 participants