[Refactoring] deferred is necessary only for nested functions in unittests
fix Issue 12498 - ICE: while(string) causes compiler to crash during CTFE
Add assertion to detect internal failure in early stage
Merge pull request #3422 from 9rnsr/fix12498

Issue 12498 - ICE: while(string) causes compiler to crash during CTFE
Merge pull request #3421 from 9rnsr/refactor_glue

[Refactoring] deferred is necessary only for nested functions in unittests
fix mismatch of the scope push/pop paring
[Refactoring] Replace new Scope(*sc) to sc->copy()
fix Issue 11777 - [ICE] dmd memory corruption as `Scope::pop` `free`s `fieldinit` used also in `enclosing`
Merge pull request #3423 from 9rnsr/fix11777

[REG2.065] Issue 11777 - [ICE] dmd memory corruption as `Scope::pop` `free`s `fieldinit` used also in `enclosing`
fix Issue 12523 - wrong type deduced for foreach ref argument

- No need to change the storage class because the var type
  already has inferred modifiers.
Merge pull request #3424 from MartinNowak/fix12523

fix Issue 12523 - wrong type deduced for foreach ref argument
Supply scope for addMember call
[Refactoring] AttribDeclaration::createNewScope
[Refactoring] AttribDeclaration::newScope
Generalize addMember and importAll for derived class of AttribDeclaration
Generalize semantic2 and semantic 3
Always delay static-if condition evaluation
Fix issue 313 & 314

Points:

1. Most of import declarations will insert their fully qualified names in local symbol table.

Currently, it is stored only in one place - `Module::modules`. After this change, in addition to that,
each `ScopeDsymbol::symtab` will have the "local package tree" which represents the scope local imports.

For example:

```d
class C {
    import core.stdc.stdio;
    import core.stdc.stdlib : malloc;
    import core.stdc.stdlib : free;
    void func() {
        import core.stdc.string;
    }
}
```

`symtab` of class `C` and `C.func` will have following package object trees:

```
// in C
Package('core') <----------+
 + Package('stdc') <-------|--+
    + Import('stdio')      |  |
    + Import('stdlib')     |  |
        names = ["malloc"] |  |
  +---- overnext           |  |
  |                        |  |
  +-> Import('stdlib')     |  |
        names = ["free"]   |  |
                           |  |
// in C.func()             |  |
Package('core') aliassym --+  |
 + Package('stdc') aliassym -+
    + Import('string')
```

In there, `Import` object will be the leaf of the tree.
It's done by `Import::addPackage`.

2. A part of local package tree will be merged into other tree.

This example case of public import should work.

```d
module a;
public import std.stdio;
```
```d
module b;
import a;
import std.algorithm;
std.stdio.writeln();    // point
```

In module b, 'std.stdio' should be visible. To realize it, import declarations will pull
the fully qualified name of public imports in the imported module.
Finally, module b will have the package tree:

```d
Package('std')
 + Package('algorithm')
 + Package('stdio')   <--- Pulled from module a, by `import a;`
```

Same work is necessary on class inheritance. Public/protected imports in base class scope
should be pulled in the derived class scope.
Add test/compilable/testimport1.d
Add test/compilable/testimport2.d