private void importStar(@NotNull Scope s, @Nullable ModuleType mt, int tag) {
        if (mt == null || mt.getFile() == null) {
            return;
        }

        Module mod = Indexer.idx.getAstForFile(mt.getFile());
        if (mod == null) {
            return;
        }

        List<String> names = new ArrayList<String>();
        Type allType = mt.getTable().lookupType("__all__");

        if (allType != null && allType.isListType()) {
            ListType lt = allType.asListType();

            for (Object o: lt.values) {
                if (o instanceof String) {
                    names.add((String) o);
                }
            }
        }

        if (!names.isEmpty()) {
            for (String name : names) {
                Binding nb = mt.getTable().lookupLocal(name);
                if (nb != null) {
                    s.put(name, nb);
                } else {
                    List<Name> m2 = new ArrayList<Name>(module);
                    m2.add(new Name(name));
                    ModuleType mod2 = Indexer.idx.loadModule(m2, s, tag);
                    s.put(name, null, mod2, Binding.Kind.MODULE, tag);
                }
            }
        } else {
            // Fall back to importing all names not starting with "_".
            for (Entry<String, Binding> e : mt.getTable().entrySet()) {
                if (!e.getKey().startsWith("_")) {
                    s.put(e.getKey(), e.getValue());
                }
            }
        }
    }