-
Notifications
You must be signed in to change notification settings - Fork 789
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
reporting unnamed fields in an FCS helper function #15668
Closed
smoothdeveloper
wants to merge
5
commits into
dotnet:main
from
smoothdeveloper:diagnostic-unnamed-fields
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c09b303
testing waters for reporting unnamed fields in an FCS helper function
smoothdeveloper a6a1c1e
assertion in case of failure
smoothdeveloper e18e30e
adding private du and exception
smoothdeveloper fdd2d1a
fixing typo, handling exception fields, define options for where to c…
smoothdeveloper b4f08a9
Merge branch 'main' into diagnostic-unnamed-fields
vzarytovskii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/service/data/analysis/unammed-fields/unnamed.members.diagnostics.bsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(4,19--4,22) | ||
(10,13--10,16) | ||
(14,26--14,29) | ||
(20,20--20,23) | ||
(24,33--24,36) |
27 changes: 27 additions & 0 deletions
27
tests/service/data/analysis/unammed-fields/unnamed.members.diagnostics.fsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
type TopLevelDU = | ||
| TopLevelCase1 of int | ||
| TopLevelCase2 of ok: int * okok: string | ||
| TopLevelCase3 of int * noOkCase: string | ||
|
||
module Outer = | ||
type DU = | ||
| Case1 of int | ||
| Case2 of ok: int * okok: string | ||
| Case3 of int * noOkCase: string | ||
|
||
exception Exception1 of int | ||
exception Exception2 of ok: int * okok: string | ||
exception Exception3 of int * noOkCase: string | ||
|
||
module Inner = | ||
type InnerDU = | ||
| InnerCase1 of int | ||
| InnerCase2 of ok: int * okok: string | ||
| InnerCase3 of int * noOkCase: string | ||
|
||
exception InnerException1 of int | ||
exception InnerException2 of ok: int * okok: string | ||
exception InnerException3 of int * noOkCase: string | ||
|
||
type PrivateDU = private PrivateCase1 of int * string | ||
exception private PrivateException of int * string |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Probably not a good idea until we move to a new released
FSharp.Core
which has this attribute already.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.
Thanks & understood, fresh paint stuff in FSharp.Core needs at least one official release, is it how to look at it?
I used it because I was unsure my code was
TailCall
orStackOverflow
(due toyield!
), I don't know how deeply nested code is going to be passed, but I'm hopeful there is headroom in case I missed something making it non TCR-Optimized.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.
Yeah, pretty much. Because some "flavours" of FCS are built with FSharp.Core from nuget. I know @auduchinok uses it.
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.
Are there CI empowered people that would put a hard check on this?
I don't know how that would play, beside having a "public surface area" diff and analysis to see which members are getting exposed in the FCS codebase.
Maybe there are other ways?
Just speculating this could be a removed burden for code reviewers (if we find a robust way of doing).
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.
It's already there, but it's not failing CI, since I wasn't sure it was stable enough:
https://dev.azure.com/dnceng-public/public/_build/results?buildId=352682&view=logs&j=119f12ab-97c9-53f0-7ea6-00e6f97fda11&t=5269ef62-afc8-5810-682c-8c493ccd0e61
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.
Stellar team!