@@ -178,19 +178,15 @@ $(GNAME ImportDeclaration):
178
178
179
179
$(GNAME ImportList):
180
180
$(I Import)
181
- $(I ImportBindings)
182
181
$(I Import) $(D ,) $(I ImportList)
183
182
184
183
$(GNAME Import):
185
184
$(I ModuleFullyQualifiedName)
186
185
$(I ModuleAliasIdentifier) $(D =) $(I ModuleFullyQualifiedName)
186
+ $(I ImportBindings)
187
187
188
188
$(GNAME ImportBindings):
189
- $(I Import) $(D :) $(I ImportBindList)
190
-
191
- $(GNAME ImportBindList):
192
- $(I ImportBind)
193
- $(I ImportBind) $(D ,) $(I ImportBindList)
189
+ $(I Import) $(D :) $(I ImportBind)
194
190
195
191
$(GNAME ImportBind):
196
192
$(I Identifier)
@@ -407,6 +403,23 @@ void main()
407
403
408
404
$(P $(D static) cannot be used with selective imports.)
409
405
406
+ $(P Selective `import`s can be made from multiple modules if
407
+ all `import`s are selective, or when the imported module has a qualified name:)
408
+
409
+ $(SPEC_RUNNABLE_EXAMPLE_COMPILE
410
+ ---
411
+ import std.stdio : writeln, writefln, std.file : write, std.ascii;
412
+
413
+ void main()
414
+ {
415
+ writeln("hello!"); // ok, writeln from std.stdio
416
+ writefln("%s!", "hello"); // ok, writefln from std.stdio
417
+ write("world.txt", "hello"); // ok, write from std.file
418
+ writeln(digits); // ok, digits from std.ascii
419
+ }
420
+ ---
421
+ )
422
+
410
423
$(H2 $(LNAME2 renamed_selective_imports, Renamed and Selective Imports))
411
424
412
425
$(P When renaming and selective importing are combined:)
0 commit comments