Skip to content

Fix #19813 - Parse indexed mixin templates#23300

Open
0-v-0 wants to merge 2 commits into
dlang:masterfrom
0-v-0:issue19813
Open

Fix #19813 - Parse indexed mixin templates#23300
0-v-0 wants to merge 2 commits into
dlang:masterfrom
0-v-0:issue19813

Conversation

@0-v-0

@0-v-0 0-v-0 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #19813

@dkorpel dkorpel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grammar currently doesn't permit indexing. We could add this, but it comes arbitrary what is allowed and what isn't. Why not allow any type syntax to appear, including traits and string mixin?

mixin template A() {}
mixin mixin("A");

Comment thread compiler/src/dmd/parse.d
Comment on lines +1852 to +1857
while (token.value == TOK.leftBracket)
{
nextToken();
tqual.addIndex(parseAssignExp());
check(TOK.rightBracket);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch isn't covered by the test

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.

mixin of mixin template in indexed tuple not allowed

3 participants