D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11038 - static has no effect as a block attribute for imports
Summary: static has no effect as a block attribute for imports
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2013-09-14 06:44 UTC by Andrej Mitrovic
Modified: 2021-04-03 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-09-14 06:44:33 UTC
Some attributes, such as public, can be used to mark several imports as public, for example:

-----
module bar;

public
{
    import std.range;
    import std.stdio;
}
-----

-----
module test;

import bar;

void main()
{
    writeln("foo".empty);
}
-----

This compiles. However static does not have an effect on imports:

-----
module test;

static
{
    import std.range;
    import std.stdio;
}

void main()
{
    writeln("foo".empty);  // compiles
}
-----
Comment 1 Dlang Bot 2019-11-06 11:57:04 UTC
@RazvanN7 created dlang/dmd pull request #10541 "Fix Issue 11038 - static has no effect as a block attribute for imports" fixing this issue:

- Fix Issue 11038 - static has no effect as a block attribute for imports

https://github.com/dlang/dmd/pull/10541
Comment 2 Dlang Bot 2019-11-18 11:20:09 UTC
dlang/dmd pull request #10541 "Fix Issue 11038 - static has no effect as a block attribute for imports" was merged into master:

- 08808ba15882d75dc5c2ca911db29150413181e8 by RazvanN7:
  Fix Issue 11038 - static has no effect as a block attribute for imports

https://github.com/dlang/dmd/pull/10541
Comment 3 Dlang Bot 2021-04-03 01:03:35 UTC
dlang/dmd pull request #12350 "[dmd-cxx] More fixes for package import visibility" was merged into dmd-cxx:

- 4e43ce774bea36cc87fc6df027ab8a65f9db48a5 by RazvanN7:
  [dmd-cxx] Fix Issue 11038 - static has no effect as a block attribute for imports

https://github.com/dlang/dmd/pull/12350