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

Syntax error parsing field initializer with ref expression #64720

Closed
cston opened this issue Oct 13, 2022 · 0 comments · Fixed by #64817
Closed

Syntax error parsing field initializer with ref expression #64720

cston opened this issue Oct 13, 2022 · 0 comments · Fixed by #64817

Comments

@cston
Copy link
Member

cston commented Oct 13, 2022

Compile:

ref struct R
{
    ref int _f = ref F(); // error CS1525: Invalid expression term 'ref'

    public R()
    {
    }

    static ref int F() => throw null;
}

Expected: no errors

Actual:

(3,18): error CS1525: Invalid expression term 'ref'

See related #64725.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 13, 2022
@jcouv jcouv added this to the 17.5 milestone Oct 13, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants