Uh oh!
There was an error while loading. Please reload this page.
Deduplicate module names - #2728
Conversation
cartermp
commented
Mar 29, 2017
@alfonsogarciacaro You can always say |
vasily-kirichenko
commented
Mar 30, 2017
@alfonsogarciacaro you can run those failing tests locally, no need to wait long time until CI finishes. |
@cartermp@vasily-kirichenko The build script refuses to run the tests locally for me. |
vasily-kirichenko
commented
Mar 30, 2017
@alfonsogarciacaro Install NUnit 3 test runner adapter VS extension, find a failing test in test explorer and run it. |
forki
commented
Mar 30, 2017
tests now work on my machine. |
forki
commented
Mar 30, 2017
@alfonsogarciacaro it looks it's one step further. It can't write down the IL because the module is twice in the ILTypeDef list @dsyme it's failing at: |
forki
commented
Mar 30, 2017
I think the whole approach is wrong. These implicit modules need to get different internal names. I think we discussed that already somewhere. I will try to look deeper tomorrow. But the qname sorter is definitely too late and fixes only symptoms |
alfonsogarciacaro
commented
Mar 30, 2017
A couple of notes:
|
dsyme
commented
Mar 30, 2017
@alfonsogarciacaro I'll wirk on this first thing in the morning, followed by the stack overflow issue. I understand now how important this is for Fable 1.0 |
alfonsogarciacaro
commented
Mar 30, 2017
@dsyme Awesome, thank you! |
forki
commented
Mar 31, 2017
I think I fixed it with this deduplication trick: https://github.com/alfonsogarciacaro/visualfsharp/pull/4/commits/7fcc07d50ade37f9e3269c73dc77ecc48309343c#diff-d58c6e25aebd2ff64de33a050b0228ccR1766 |
forki
commented
Mar 31, 2017
OK. I think now Impl and Sig files are synced and deduplicated. Ready for review |
forki
commented
Mar 31, 2017
Open Question: do we need to do the same for fsi? |
There was a problem hiding this comment.
I find the old code more compact and readable.
There was a problem hiding this comment.
Other unused fields are ignored with _, so should _fileName.
There was a problem hiding this comment.
It's unclear what type this seen thing has. Could you add a comment or, at least, types?
There was a problem hiding this comment.
These two branches have a lot in common. Maybe it's worth to extract some logic in a function or two?
There was a problem hiding this comment.
Yeah, my preference is to encapsulate such name generators (though I haven't done it particularly well - see the ones in ast.fs which are not suitable here since they use range line number information). So
typeUniqueNameGenerator()=letseen= Dictionary...memberx.GetName(text)=match seen.TryGetValue text with|true, paths ->letcount=if paths.Contains path then paths.Count else paths.Count +1
seen.[text]<- Set.add path paths
if count =1then text else text +"___"+ count.ToString()etc
There was a problem hiding this comment.
Why nested try..with? Is it for handling possible exceptions thrown by error(Error(FSComp.SR.fscProblemWritingBinary(outfile, msg), rangeCmdArgs))?
There was a problem hiding this comment.
He's just changing the indenting in this case ( @forki - perhaps remove the formatting changes to make the PR minimal? I don't mind either way though)
vasily-kirichenko
commented
Mar 31, 2017
It's hard to review because of lots of whitespace changes. |
forki
commented
Mar 31, 2017
via email
As written in slack I will revert all changes that are unrelated. Stay
tuned
Am 31.03.2017 14:11 schrieb "Vasily Kirichenko" <notifications@github.com>: … It's hard to review because of lots of whitespace changes.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2728 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNBNVvQBNHihKofKtkOLpdXX7aW30ks5rrO1fgaJpZM4MtEnP>
.
|
dsyme
commented
Mar 31, 2017
@forki Stepping back a bit, this whole QualifiedNameOfFile stuff is really irritating. AFAICS it's only used for the names given to these internally generated classes: That's all. Just a simple name. So easy. I believe the only issue is that name must match between the processing of the signature of implementation - because other files are allowed to access straight into these items - e.g. when taking the address of a mutable static fields. So on a quick glance your approach is basically right - generate nice names but be careful about de-duplicating. That said, there's probably a much easier way to do this all (the whole thing, not just the de-duplicating) given the end result is so simple, or even just to somehow get rid of the information altogether |
forki
commented
Mar 31, 2017
My approach is to try to not break backwards compatibility. ;-) |
There was a problem hiding this comment.
He's just changing the indenting in this case ( @forki - perhaps remove the formatting changes to make the PR minimal? I don't mind either way though)
There was a problem hiding this comment.
Yeah, my preference is to encapsulate such name generators (though I haven't done it particularly well - see the ones in ast.fs which are not suitable here since they use range line number information). So
typeUniqueNameGenerator()=letseen= Dictionary...memberx.GetName(text)=match seen.TryGetValue text with|true, paths ->letcount=if paths.Contains path then paths.Count else paths.Count +1
seen.[text]<- Set.add path paths
if count =1then text else text +"___"+ count.ToString()etc
dsyme
commented
Mar 31, 2017
Agreed. |
dsyme
commented
Mar 31, 2017
@alfonsogarciacaro You say you need this for Fable 1.0 - I presume you need it integrated to FCS? thanks |
alfonsogarciacaro
commented
Mar 31, 2017
@forki has removed the whitespace changes and I've tried to implement some of the comments, please review. @dsyme Yes, this would be needed for FCS. I can send a PR there but I guess it's no use, as changes in this repo will flow to FCS anyway. It would be ideal if a new FCS version is pushed to nuget, but it it's cumbersome to do it at this moment, I can just fork it and add the change manually for the time being. |
dsyme
commented
Mar 31, 2017
@alfonsogarciacaro Please submit just the fix to FCS. Don't worry about the test |
KevinRansom
commented
Mar 31, 2017
@alfonsogarciacaro Kevin |



Giving it a shot at continuing #2686. Apparently I cannot run the tests locally so let see what CI says.