Skip to content
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

Conversation

smoothdeveloper
Copy link
Contributor

@smoothdeveloper smoothdeveloper commented Jul 22, 2023

first bit of proof of concept for #15665

note to self: #14055 for reference of fixers dealing with DU fields.

I'm not clear if there are other things that could be checked, maybe we'd like to report bindings that are deconstructing types in function signatures; but this doesn't feel like an idiom to discourage (to me).

  • report DU case fields
  • report Exception fields

@smoothdeveloper smoothdeveloper requested a review from a team as a code owner July 22, 2023 15:38
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: uNNaMed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psfinaki, thanks for going where none of my spell checker could ever reach!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one embedded in my brains, sorry :D

…heck (just as internal implementation detail for now)
|| isNull field.Name
|| System.String.Empty = field.Name

[<TailCall>]
Copy link
Member

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.

Copy link
Contributor Author

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 or StackOverflow (due to yield!), 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.

Copy link
Member

@vzarytovskii vzarytovskii Jul 26, 2023

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?

Yeah, pretty much. Because some "flavours" of FCS are built with FSharp.Core from nuget. I know @auduchinok uses it.

Copy link
Contributor Author

@smoothdeveloper smoothdeveloper Jul 26, 2023

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).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stellar team!

@psfinaki
Copy link
Member

Hi @smoothdeveloper, are you still interested in tackling this PR? :)

@nojaf
Copy link
Contributor

nojaf commented Feb 7, 2024

This is available as an analyzer at https://ionide.io/ionide-analyzers/suggestion/004.html.
I would not pursue to have this in the compiler.

@abonie
Copy link
Member

abonie commented Aug 12, 2024

Closing since the same functionality is already available as an analyzer

@abonie abonie closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants