-
Notifications
You must be signed in to change notification settings - Fork 803
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 name-demangleling of provided types #102
Conversation
I also wonder if this is the right place for the tests. |
I still think it would be better to not let the strange logical names happen in the first place. |
@@ -65,6 +65,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="NUnitFrameworkShims.fs" Condition="'$(TargetFramework)' == 'sl3-wp'" /> | |||
<Compile Include="ManglelingNameOfProvidedTypes.fs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proper spelling is "mangling"
Looks nice. Just a couple cleanup suggestions. |
There is still the question if this is the right fix. |
see #203 for the second approach. |
closing this in favor of #203 |
fixes #102 closes #203 commit 6cc3227 Author: Steffen Forkmann <[email protected]> Date: Tue Feb 3 15:30:23 2015 +0100 Do not generate logical type names like "MyNamespace.Test," commit b40d937 Author: Steffen Forkmann <[email protected]> Date: Sun Jan 25 15:08:36 2015 +0100 Fix demangling of provided types with only default values - fixes #98 commit 515501a Author: Steffen Forkmann <[email protected]> Date: Sun Jan 25 14:56:45 2015 +0100 Create test case for #98 commit 5569580 Author: Steffen Forkmann <[email protected]> Date: Sun Jan 25 14:50:04 2015 +0100 Added some tests to describe current behaviour of NameMangling of provided types commit be2d157 Author: Steffen Forkmann <[email protected]> Date: Sun Jan 25 14:22:49 2015 +0100 Extract computeMangledNameWithoutDefaultArgValues to make it testable commit bbdd2a3 Author: Steffen Forkmann <[email protected]> Date: Sun Jan 25 13:13:00 2015 +0100 Cleanup: removed commented code which uses deleted functions
This fixes #98
As reported in #98 the mangleling routine removes parameters which match the default value from the
typeLogicalName
. If all parameters match their default value we have a mangled name liketypeName,
which is also reported:I created a couple of unittests which pin the current behaviour. In order to do so I extracted the mangleling routine to make it testable.
I then added a testcase which tries to demangle
"MyNamespace.Test,"
and fails.The last commit uses the strategy @vladima suggested in #98 and fixes the test case.
I think this will work fine, but I wonder if we should fix https://github.com/Microsoft/visualfsharp/blob/fsharp4/src/fsharp/PrettyNaming.fs#L466 instead and just don't generate logical type names with trailing
,
.