Seems to be throwing an error, instead of returning false on non-matching values.
Seems to be missing a case where an union case tester method is neither IsProperty nor IsMethod (but it is IsPropertyGetterMethod).
Perhaps it's missing the | V v -> ... case, maybe something like this?
member _.IsUnionCaseTester =
checkIsResolved()
match d with
| P p -> p.IsUnionCaseTester
| M m -> m.IsUnionCaseTester
| V v -> v.IsPropertyGetterMethod && v.LogicalName.StartsWith("get_Is") // or something like it
| E _ | C _ -> false // fixed to return boolean
Related to #16341
Tested on .NET 8.0, with <LangVersion>preview</LangVersion>.
2 issues with IsUnionCaseTester:
false
on non-matching values.IsProperty
norIsMethod
(but it isIsPropertyGetterMethod
).Perhaps it's missing the
| V v -> ...
case, maybe something like this?Related to #16341 Tested on .NET 8.0, with
<LangVersion>preview</LangVersion>
.