Bug 21865 – Grammar has no rule for Traits

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-26T07:44:47Z
Last change time
2021-07-09T00:23:51Z
Assigned to
No Owner
Creator
Mario Kroeplin

Comments

Comment #0 by kroeplin.d — 2021-04-26T07:44:47Z
https://dlang.org/spec/grammar.html shows in "3.4 Types" BasicType: Traits but the link on Traits does not work because there is no grammar rule with Traits on the left-hand side. Consider removing Traits in https://github.com/dlang/dlang.org/blob/master/spec/type.dd (TraitsExpression is used in "3.7 Expressions" and defined in "3.17 Traits". No idea, what a Traits type should be.)
Comment #1 by b2.temp — 2021-04-26T08:36:01Z
No, it must not be removed but the link must be fixed. TypeTrait exists internally (search Ttrait). The principle is analogous to QualifiedIdentifier. Just like them, __traits() resolves to something that is a Type or not. And depending on that it is rejected or not during the semantic passes.
Comment #2 by dkorpel — 2021-07-09T00:23:51Z
BasicType has a working link to TraitsExpression since https://github.com/dlang/dlang.org/pull/3019