Extended property patterns: few more tests#53874
Extended property patterns: few more tests#53874jcouv merged 4 commits intodotnet:features/extended-property-patternsfrom
Conversation
|
@333fred @dotnet/roslyn-compiler for review. This is just adding a few tests we discussed during feature review. Thanks |
|
@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; } } |
| code, | ||
| indentationLine: 8, | ||
| expectedIndentation: 12); | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Adjusted test to cover this (I think)
| { | ||
| } | ||
| } | ||
| ", parseOptions: CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Preview)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
seems... bad :) it's not blocking, but i would say this is a basic completion scenario we want to get working by ship time.
There was a problem hiding this comment.
Why would this work in this branch or main branch (ie. without support for list-patterns)?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
Adding remaining tests from test plan and from feature review discussion.
Test plan #52468
FYI @alrz