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

Extended property patterns: few more tests #53874

Merged

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Jun 4, 2021

Adding remaining tests from test plan and from feature review discussion.

Test plan #52468
FYI @alrz

@jcouv jcouv added this to the C# 10 milestone Jun 4, 2021
@jcouv jcouv self-assigned this Jun 4, 2021
@jcouv jcouv marked this pull request as ready for review June 4, 2021 10:54
@jcouv jcouv requested review from a team as code owners June 4, 2021 10:54
@jcouv jcouv requested a review from CyrusNajmabadi June 4, 2021 10:54
@jcouv jcouv added the Test Test failures in roslyn-CI label Jun 4, 2021
@jcouv
Copy link
Member Author

jcouv commented Jun 4, 2021

@333fred @dotnet/roslyn-compiler for review. This is just adding a few tests we discussed during feature review. Thanks

@jcouv
Copy link
Member Author

jcouv commented Jun 7, 2021

@CyrusNajmabadi @333fred @dotnet/roslyn-compiler for review. This is just adding a few tests we discussed during feature review. Thanks

{
public C Instance { get; set; }
public static C Static { get; set; }
public bool True { get { System.Console.Write(""True ""); return true; } }
Copy link
Member

@cston cston Jun 8, 2021

Choose a reason for hiding this comment

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

public bool True

Minor: This property is not used. #Resolved

code,
indentationLine: 8,
expectedIndentation: 12);
}
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi Jun 8, 2021

Choose a reason for hiding this comment

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

can you add a test with this form:

class C
{
    void M()
    {
        _ = this is
        {

            A.B: 1,

Where we're testing the indentation above A.B: 1
#Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Adjusted test to cover this (I think)

{
}
}
", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview));
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi Jun 8, 2021

Choose a reason for hiding this comment

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

this is actually a bit odd since patterns have to be constant, and you can't have constants of user defined types. that said... seems fine for us to do this since i don't have anything that would be better :) #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically, you can have constants of user-defined types, but it must be null :-P

showCompletionInArgumentLists:=showCompletionInArgumentLists, languageVersion:=LanguageVersion.Preview)

' We don't yet offer expression completion in this context (could be a constant for a list-pattern)
state.SendTypeChars("CP")
Copy link
Member

Choose a reason for hiding this comment

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

seems... bad :) it's not blocking, but i would say this is a basic completion scenario we want to get working by ship time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why would this work in this branch or main branch (ie. without support for list-patterns)?

Copy link
Member

Choose a reason for hiding this comment

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

sorry, the comment int eh code confused me. it sounded like you were saying this shoudln't work even with list patterns.

I would instead have this test state that this is expected behavior prior to list pattenrs comining online. Then we shoudl have a tracking bug that ensures that this scenario works when we do list patterns :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry the comment wasn't clear. I'll tweak the wording.

There's no need for tracking bug. List-patterns is in active development, so we're tracking work remaining in the test plan.
Also, I have a PR queued that fixes that for list-patterns already (it's waiting on another PR to merge first) ;-)
https://github.com/dotnet/roslyn/pull/53850/files#diff-31303c421816ee9001acbb872ec31e6ef3d701cd04eba6f2a41d02e49d70ae21

@jcouv jcouv enabled auto-merge (squash) June 8, 2021 04:54
@jcouv jcouv disabled auto-merge June 8, 2021 05:07
@jcouv jcouv enabled auto-merge (squash) June 8, 2021 05:13
@jcouv jcouv merged commit 5de28db into dotnet:features/extended-property-patterns Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Area-IDE Test Test failures in roslyn-CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants