Skip to content

Fix Bugzilla Issue 24740 - Can't parse static array type property when a type is valid#22841

Closed
shagunpandeydev26-alt wants to merge 1 commit intodlang:stablefrom
shagunpandeydev26-alt:parsing-static-array
Closed

Fix Bugzilla Issue 24740 - Can't parse static array type property when a type is valid#22841
shagunpandeydev26-alt wants to merge 1 commit intodlang:stablefrom
shagunpandeydev26-alt:parsing-static-array

Conversation

@shagunpandeydev26-alt
Copy link
Copy Markdown

@shagunpandeydev26-alt shagunpandeydev26-alt commented Mar 30, 2026

Description

This PR fixes Issue 20506 where the compiler incorrectly threw an error when a void parameter was used within a template context. By checking the scope flags in typesem.d, we now allow void parameters during the initial template analysis, preventing premature compilation failure.

Related Issue

Fixes Fixes Bugzilla 24740
Fixes #20506

Changes

  • Modified visitFunction in src/dmd/typesem.d to bypass the Tvoid check if sc.stc & STC.templateparameter is true.
  • Added a regression test case in compiler/test/compilable/test20506.d (or your test filename).

Testing

  • Verified that the reported code snippet now compiles successfully.
  • Ran the full test suite using rdmd run.d to ensure no regressions.

@dlang-bot
Copy link
Copy Markdown
Contributor

dlang-bot commented Mar 30, 2026

Thanks for your pull request and interest in making D better, @shagunpandeydev26-alt! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#22841"

@shagunpandeydev26-alt shagunpandeydev26-alt force-pushed the parsing-static-array branch 2 times, most recently from 43ebd4a to 1830c13 Compare March 30, 2026 16:59
@shagunpandeydev26-alt shagunpandeydev26-alt changed the title Fix Issue 20506 - Allow void parameters in template contexts Fix Issue 20506 - Can't parse static array type property when a type is valid Mar 30, 2026
@shagunpandeydev26-alt shagunpandeydev26-alt changed the title Fix Issue 20506 - Can't parse static array type property when a type is valid Fix Issue 20506 (Bugzilla -24740)- Can't parse static array type property when a type is valid Mar 30, 2026
@shagunpandeydev26-alt shagunpandeydev26-alt changed the title Fix Issue 20506 (Bugzilla -24740)- Can't parse static array type property when a type is valid fix Bugzilla Issue 24740 - Can't parse static array type property when a type is valid Mar 30, 2026
@shagunpandeydev26-alt shagunpandeydev26-alt changed the title fix Bugzilla Issue 24740 - Can't parse static array type property when a type is valid Fix Bugzilla Issue 24740 - Can't parse static array type property when a type is valid Mar 30, 2026
@dkorpel
Copy link
Copy Markdown
Contributor

dkorpel commented Mar 30, 2026

This looks like AI slop

@dkorpel dkorpel closed this Mar 30, 2026
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.

3 participants