Fix [<RequireQualifiedAccess>] on a DU shadows types in the same module#1512
Fix [<RequireQualifiedAccess>] on a DU shadows types in the same module#1512dsyme merged 12 commits intodotnet:masterfrom
Conversation
|
why are the other CIs not testing this? |
|
the proposed fix changes name resolution in the following way:
|
|
in order to fix #1294 as well I moved the unionSearch below the tyconSearch. This ensures that we always prefer types over union cases. This change is a potential breaking change since we might actually break code that already compiled. |
|
@forki Awesome work. Will look closely soon. Will this be a breaking change in any situation? Thanks |
|
Tbh the breaking change is very very narrow. Basically the reverse of Am 02.09.2016 15:59 schrieb "Don Syme" notifications@github.com:
|
|
@OmarTawfik @forki @KevinRansom Anyone know why Jenkins CI is not running? |
|
I'm not sure anymore that this is breaking. 6b801ce suggests the case that I was thinking of still works. |
|
It seems that this change means that given (basically removing the qualified access)
|
doesn't compile in current released version So this case is fine. |
|
@forki, try |
currently compiles and would break afterwards. I guess that is the case I was looking for. @dsyme so that's the risk... @liboz: thanks for helping |
|
Another case that I broke: But not sure yet why. |
|
ok seems my "perf optimization" did too much ;-) that last case is now fixed |
|
Nice. I think though that #1294 is broken again though... I had been trying to work on these bugs as well, and got pretty stuck on how to fix #1294 and getting distracted by other stuff. Maybe there's a way to make it so that the name resolution code is shared when you |
feels like a bug IMHO |
|
@liboz: lol yes OK the following observation: If we fix #1294 like in 9d7ad99 then we break the cases that @liboz mentioned. Also the case that I reported in #1512 (comment) is a simplication of code from the F# compiler test sources (in a file called test.fsx). So we even break the compiler test cases ;-) But after thinking about it I agree with @matthid. What the compiler did was wrong: In this last line A.X is actually a type and Y is a instance function. So correct thing would be: let y = A.X.X.Y() And sure enough after reverting ec68764 this works again. |
|
In the "bug" situation can we even refer to the "C" with the "M" member (ie its constructor)? |
|
@matthid there is no order in this situation. |
|
ready for review |
|
I see CI is running now. Please let me know if you see it happening again. |
|
@forki Could you merge with master? Thanks |
|
@forki Could you merge with master? Thanks |
|
done. sorry for delay |
|
looks good to go now. |
|
changed it to run the search only once |
|
all green |
|
Thanks, great to have this glitch fixed |
|
looks like it brougt new issues. #1830 |


#1253 and #1294 show issues around name resolution. So let's fix these