I decided to see how well some of my existing projects do if I try to convert them to Mercury. This simple project basically has a single code file with various enums defined that are used by other projects in the solution. For some reason, Mercury will not compile this project - it is generating errors in “My Project-Settings.Designer.pas”, like so:
Also the Settings.Designer.vb file is different. Here’s a screenshot of the diff (the file on the left is the broken one, and the file on the right is the fixed version):
Good catch. it seems the lack of RootNamespace generates bad code in the .Designer file. fixing now.
Workaround: set a Root namespace, then it compiles fine for me.
Curious.
Hmm., the import should remove this (as we’re now generating Settings.Deisgner at compile-trime, same as Resources.Designer); there’s no way Water would add this back, so something else must be going on here.
Hmmm…I assume then that Visual Studio did it. I wonder if it would be worth it for me to start over with the code from the beginning, and look at each file more carefully as I do things, to see where things happened. Would that be useful, or does it not matter from your perspective since you know it isn’t Water?
Ugh - apparently this solution is not under source control.
I can obviously go back to the vbproj files instead of the *.elements file, but since the .Designer files also changed I can’t easily return back to that. Sorry.
But at least I know now, so I will get it hooked into source control as I look at the other projects in the solution.
I found old copies of those files designer files, and tried to replicate what happened before (after putting things under source control).
And I can’t.
In fact, I’m pretty much getting the same compile errors in both VS2019 and Water now, which I guess is good from a consistency standpoint.
So I don’t know why things suddenly started working last time, and why I can’t get that behavior this time.
But in the end, if the compiler is able to handle that issue with the lack of a RootNamespace in the .Designer file, I’m sure it will be fine. And as you pointed out - setting a Root namespace solves it.
very odd indeed.if somehow the file got added back to the project that would explain it (the build only generates Settings.Designer.pas on its own, if it’s not present; if it is, that one is used, instead.
Could be. As I go through the process of migrating the rest of this solution, I’ll try to watch things a bit more carefully so I can provide more useful feedback.