[Issue 3118] New: Need a clear spec on how inapplicable attributes are handled
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jun 30 14:26:24 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3118
Summary: Need a clear spec on how inapplicable attributes are
handled
Product: D
Version: 1.045
Platform: All
URL: http://www.digitalmars.com/d/archives/digitalmars/D/Th
e_great_inapplicable_attribute_debate_87915.html
OS/Version: All
Status: NEW
Keywords: spec
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: smjg at iname.com
Blocks: 677
If one tries to apply an argument to an entity to which it is not applicable,
how is the compiler supposed to deal with the attempt? There has been
considerable debate about it both here on Bugzilla and on the newsgroups, and
the anomalies have been widely observed.
The compiler, under certain conditions, silently ignores such inapplicable
attributes. It isn't clear what these conditions are, and there are some
conditions under which it should certainly not be happening.
There are three kinds of inapplicability to consider:
(a) attribute's meaning already implied by the context
(b) doesn't make sense in the context
(c) makes sense in the context but is nonetheless not actually applied.
Issue 1441 (later resurfaced as issue 2830) is a prime example of (c). That
any cases of (c) actually exist is bad in itself.
We need a clear spec on the whole issue. It should consider not only the three
kinds of inapplicability, but also the possible ways of specifying an
attribute:
(i) directly to the declaration
(ii) using { }
(iii) using :
(iv) inherited by the members of a compound type, in the case of one or two
attributes
AISI the most lenient policy that is reasonable is:
- allow (a) always
- allow (b) except when applied by (i)
- eradicate all cases of (c) by fixing the affected attributes to work
Whatever we do, both the spec and the compiler will need to be amended.
Further discussion at URL given.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list