Skip to content

Drop async modifier from abstract (bodyless) converted methods - #5

Closed
GrahamTheCoder wants to merge 1 commit into
masterfrom
claude/fix-1299-abstract-async
Closed

GrahamTheCoder wants to merge 1 commit into
masterfrom
claude/fix-1299-abstract-async

Conversation

@GrahamTheCoder

Copy link
Copy Markdown
Owner

Fixes icsharpcode#1299

Summary

MustOverride Async Function was converted to public abstract async Task ..., which gives CS1994. In DeclarationNodeVisitor, bodyless methods now have the async modifier removed (WithoutAsyncModifier). async is not part of the signature, so overriding methods stay async.

Tests added

  • The exact repro from the issue, including the overriding child class.
  • MustOverride Async Sub and MustOverride Async Function ... As Task(Of Integer).
  • A partial method regression test: async is kept on the implementing part, which C# permits.

The first two were confirmed red for CS1994 before the fix and are green now.

Other bodyless cases considered

VB does not allow Async on interface members or on Declare, so those can't occur. The partial definition is not affected, since the VB async is on the implementation only.

Status

The full suite was not run (usage limit reached). Only the filtered tests were run. Coverage was not collected, and there was no blind review round.

Next steps:

  • Run the full suite and compare with the master baseline.
  • Run a blind review.

Generated by Claude Code

VB allows MustOverride Async Function; C# reports CS1994 for async on a
method without a body. async is not part of the signature, so remove it
when the converted method has no body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019FEr8FVAmHV9bscZ82CChg
@GrahamTheCoder

Copy link
Copy Markdown
Owner Author

Superseded icsharpcode#1310

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.

VB -> C#: Async modifier incorrectly retained on abstract method declarations

2 participants