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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 5 08:22:49 PDT 2016


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

Steven Schveighoffer <schveiguy at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy at yahoo.com

--- Comment #14 from Steven Schveighoffer <schveiguy at yahoo.com> ---
The original bug report here, I think has some merit.

If you need to add imports to a class/struct/function in order to allow for
your declaration to make sense, then I don't see a reason why it should be
disallowed.

For instance, the original example imports core.thread, and then declares th of
type Thread. You can use members of th inside Foo, but not declare another
'Thread'. You also could not use any UFCS functions defined in core.thread (if
there are any). This leaves you with a half-working type. As far as I know,
there's no workaround.

(In reply to Walter Bright from comment #5)
> This is not a bug, the behavior is on purpose and as designed. This was
> discussed at length for an analogous case, imports in base classes.

Where is the discussion? I want to add the explanation for this to the blog
post I wrote on the import differences in 2.071, but I can't find any.

--


More information about the Digitalmars-d-bugs mailing list