Repository navigation
Commit f50d5db
[repo-assist] refactor: use isNull instead of <> null for BaseType checks (#538)
🤖 *This is an automated pull request from Repo Assist, an AI assistant.
Please review carefully before merging.*
## Summary
- Refactor: replace `ptdT.BaseType <> null` with `not (isNull
ptdT.BaseType)` at the two delegate-type-detection sites in the
generative assembly compiler (`src/ProvidedTypes.fs`).
## Rationale
`dotnet fsharplint` (rule [FL0065]((fsprojects.github.io/redacted)
flagged both occurrences: idiomatic F# prefers `isNull`/`not (isNull
...)` over structural inequality (`<> null`) against reference types,
since `<>` on some types can invoke a custom equality implementation
rather than a plain reference/null check. `isNull` is the intended,
purpose-built operator for this check.
## Trade-offs
- Purely cosmetic/idiomatic — no behavioral change. `BaseType` is a
`System.Type`, whose default equality is reference-based, so `<> null`
and `not (isNull ...)` are semantically identical here; the change only
improves clarity and lint-cleanliness.
## Test Status
- `dotnet build src/FSharp.TypeProviders.SDK.fsproj -c Release`:
**Passed** — 0 warnings, 0 errors (netstandard2.0 + net8.0)
- `dotnet test tests/FSharp.TypeProviders.SDK.Tests.fsproj -c Release`:
**Passed** — 165/165 tests, 0 failures, 0 skipped
- `dotnet fsharplint lint src/FSharp.TypeProviders.SDK.fsproj`: the two
FL0065 warnings are resolved; two unrelated pre-existing FL0072
(`failwith` argument uniqueness) warnings remain and are out of scope
for this change.
> Generated by 🌈 Repo Assist, see [workflow
run](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/35183734406).
[Learn
more](https://github.com/githubnext/agentics/blob/main/docs/repo-assist.md).
> <sub>Comment <em>/repo-assist</em> to run again</sub>
>
<details>
<summary><sub>Add this agentic workflow to your repo</sub></summary>
To install this agentic workflow, run
```
gh aw add githubnext/agentics@4bc8419
```
</details>
<!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, model: auto,
id: 35183734406, workflow_id: repo-assist, run:
https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/35183734406
-->
<!-- gh-aw-workflow-id: repo-assist -->
<!-- gh-aw-workflow-call-id:
fsprojects/FSharp.TypeProviders.SDK/repo-assist -->
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4f22d31 commit f50d5db
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15982 | 15982 | | |
15983 | 15983 | | |
15984 | 15984 | | |
15985 | | - | |
| 15985 | + | |
15986 | 15986 | | |
15987 | 15987 | | |
15988 | 15988 | | |
| |||
16065 | 16065 | | |
16066 | 16066 | | |
16067 | 16067 | | |
16068 | | - | |
| 16068 | + | |
16069 | 16069 | | |
16070 | 16070 | | |
16071 | 16071 | | |
| |||
0 commit comments