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

List patterns: no error is emitted when Length is missing or inaccessible #59465

Closed
sa-exe opened this issue Feb 10, 2022 · 2 comments · Fixed by #59475
Closed

List patterns: no error is emitted when Length is missing or inaccessible #59465

sa-exe opened this issue Feb 10, 2022 · 2 comments · Fixed by #59475

Comments

@sa-exe
Copy link

sa-exe commented Feb 10, 2022

Version Used: main (27 Jan 2022, 3b32fc3)

Steps to Reproduce:

using System;

_ = new S() is [];

struct S
{
  public int this[Index i] => i.Value;
  // Introducing a private Length property won't change the result
  // private int Length => 42;
}

Expected Behavior: a compiler error is emitted saying that the Length property is required but missing/inaccessible.

Actual Behavior:
error CS7038: Failed to emit module '_': Unable to determine specific cause of the failure.

Relates to test plan #51289

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 10, 2022
@RikkiGibson
Copy link
Contributor

fyi @alrz @jcouv

@jcouv jcouv self-assigned this Feb 11, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 11, 2022
@jcouv jcouv added this to the 17.2 milestone Feb 11, 2022
@jcouv jcouv added the 4 - In Review A fix for the issue is submitted for review. label Feb 11, 2022
@jcouv jcouv removed the 4 - In Review A fix for the issue is submitted for review. label Feb 17, 2022
@jcouv
Copy link
Member

jcouv commented Feb 17, 2022

Thanks @SomeAnonDev for reporting this. The fix was merged for 17.2p2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants