[Issue 15925] -transition=[check]imports ignores import declaration from mixin templates

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 19 16:27:46 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15925

--- Comment #19 from det <2krnk at gmx.net> ---
(In reply to Mathias Lang from comment #18)
> The rationale is that this behavior allowed symbol hijacking.
> 
> The behavior of the compiler was changed to perform 2 passes for symbol
> resolution, the first one on local symbol, the second one on imports.
> ...
> See https://issues.dlang.org/show_bug.cgi?id=10378 for the actual issue.

i think the problem steve and i have is that the communicated changes that came
with 2.071 are the following two
1) don't be able to use symbols that are not visible (which is of course
according to specs but was not enforced beforehand)
2) change in lookup sequence to prevent hijacking

(2) relates to your examples in c18 and
https://issues.dlang.org/show_bug.cgi?id=10378

however, the issue here WRT mixin templates is the following:
it is NOT just (2) at work, i.e. a change in lookup sequence - which would be
straightforward. but rather, whole module imports mixed in are completely
ignored. why such an enforcement? it seems overly excessive and restrictive as
just an application of (2) would have prevented hijacking.

and unlike the well communicated changes (1) and (2) this new behavior is NOT
supported by the current language specs and has so far not been officially
communicated anywhere.

when ppl's code fails (as happened to me), they search the specs, find nothing,
search the bug tracker/issues, find this very example of the problem, and see
it is marked as fixed - in contradiction to the issue being persistent. yes,
the changed subject gives a hint but i still favor a split into a 2 issues:
o this one being 'resolved invalid'
o a new 'see also' linked issue that is 'resolved fixed'
and of course official documentation/specs that reflect the changes in
behavior.

--


More information about the Digitalmars-d-bugs mailing list