Repository navigation
Commit 99f4812
[repo-assist] tests: cover ProvidedTypeBuilder.MakeTupleType isStruct overload and large-tuple encoding (#541)
🤖 *This is an automated pull request from Repo Assist, an AI assistant.
Please review carefully before merging.*
## Summary
- Tests: Add 2 regression tests for `ProvidedTypeBuilder.MakeTupleType`:
- The `isStruct: bool` overload, verifying it produces
`System.ValueTuple<...>`-based types (vs. `System.Tuple<...>` for
`isStruct = false`), and that the single-argument overload defaults to
`isStruct = false`.
- The recursive "rest" tuple encoding used for tuples with more than 8
elements (e.g. a 9-element tuple becomes `Tuple<T1..T7, Tuple<T8,T9>>`),
for both reference and struct tuples.
## Rationale
`ProvidedTypeBuilder.MakeTupleType` is a public SDK API used by type
provider authors to build tuple types (including via F# quotation-based
code generation, where struct tuples and large tuples both arise
naturally). Before this change, only the small (2-element), non-struct
case was exercised by the test suite — the `isStruct = true` branch and
the `>8`-element recursive-encoding branch (`tupleNames.[n - 1 + (if
isStruct then 9 else 0)]` and the recursive `mkTupleType` call in
`src/ProvidedTypes.fs`) had no direct test coverage.
## Trade-offs
- Test-only change; no production code modified.
## Test Status
- `dotnet test tests/FSharp.TypeProviders.SDK.Tests.fsproj -c Release`:
**Passed** — 167/167 tests, 0 failures, 0 skipped (net8.0). This
includes the 2 new tests (total was 165 before this change).
- `dotnet build src/FSharp.TypeProviders.SDK.fsproj -c Release`:
**Passed** — 0 warnings, 0 errors (netstandard2.0 + net8.0)
- `./build.sh RunTests` (FAKE) was not used because FAKE's `RunTests`
target requires resolving the SDK's runtime pack list over the network,
which is blocked by the sandbox proxy (403) in this environment. `dotnet
test` was used directly as a reliable substitute and passed cleanly.
> [!WARNING]
> <details>
> <summary>Firewall blocked 1 domain</summary>
>
> The following domain was blocked by the firewall during workflow
execution:
>
> - `dotnetcli.azureedge.net`
>
> To allow these domains, add them to the `network.allowed` list in your
workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "dotnetcli.azureedge.net"
> ```
>
> See [Network
Configuration](https://github.github.com/gh-aw/reference/network/) for
more information.
>
> </details>
> Generated by 🌈 Repo Assist, see [workflow
run](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/35957718071).
[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: 35957718071, workflow_id: repo-assist, run:
https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/35957718071
-->
<!-- 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 d208217 commit 99f4812
1 file changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
642 | 676 | | |
643 | 677 | | |
644 | 678 | | |
| |||
0 commit comments