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

Recursive use of inline member should produce better diagnostic #17991

Open
vzarytovskii opened this issue Nov 11, 2024 · 1 comment
Open

Recursive use of inline member should produce better diagnostic #17991

vzarytovskii opened this issue Nov 11, 2024 · 1 comment
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Bug Feature Request Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@vzarytovskii
Copy link
Member

The following code

type ID3(vl: _) =
    member _.Value = vl

    member inline this.FastEquals(other: ID3) =
        this.FastEquals(other)

Is currently producing the following diagnostics:

    error FS1114: The value '_.ID3.FastEquals' was marked inline but was not bound in the optimization environment
    error FS1113: The value 'FastEquals' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
    error FS1114: The value '_.ID3.FastEquals' was marked inline but was not bound in the optimization environment
    error FS1113: The value 'FastEquals' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
    error FS1114: The value '_.ID3.FastEquals' was marked inline but was not bound in the optimization environment
    error FS1113: The value 'FastEquals' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible
    error FS1114: The value '_.ID3.FastEquals' was marked inline but was not bound in the optimization environment
    error FS1113: The value 'FastEquals' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible

which are quite misleading.

I propose we improve diagnostic with something like "Functions and members cannot be both inline and recursive".

@edgarfgp
Copy link
Contributor

Reminds me of #17899.

@psfinaki psfinaki added Bug Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. Area-Diagnostics mistakes and possible improvements to diagnostics and removed Needs-Triage labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Diagnostics mistakes and possible improvements to diagnostics Bug Feature Request Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
Status: New
Development

No branches or pull requests

3 participants