Skip to content

Fix generic async result double wrapping - #2765

Merged
DavidObando merged 1 commit into
mainfrom
fix/2751-async-generic-result
Jul 22, 2026
Merged

Fix generic async result double wrapping#2765
DavidObando merged 1 commit into
mainfrom
fix/2751-async-generic-result

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • preserve authoritative generic method arguments through bound-tree rewrites and async spilling
  • infer fallback MethodSpec arguments from the declared async result by removing exactly one observable Task/ValueTask wrapper
  • cover open/closed generic runtime + ILVerify, non-generic, imported, nested Task, tuple, and non-async negative controls

Verification

  • baseline exact repro: 2 StackUnexpected findings (Task<Task<T0>> and Task<Task<int32>>)
  • fixed exact repro: ILVerify clean and runtime output 42
  • targeted Core.Tests: 2 passed
  • targeted Compiler.Tests: 4 passed
  • full Core.Tests: 6,693 passed, 1 skipped
  • full Compiler.Tests: 3,405 passed (after building the required Gsharp.Extensions prerequisite)

Deferred work

  • None

Fixes #2751

@DavidObando
DavidObando merged commit de482be into main Jul 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gsc: generic async method result is double-wrapped as Task<Task<T>>

1 participant