public RawType qualifyType(String type) {
        List<RawType> options = new ArrayList<RawType>();
        for (SpecificImport imp : specificImports)
            if (imp.type.equals(type))
                options.add(new RawType(imp.module, type));
        if (options.isEmpty())
            for (WildcardImport imp : wildcardImports) {
                RawType qualifiedType = new RawType(imp.module, type);
                if (Project.singleton.hasType(qualifiedType))
                    options.add(qualifiedType);
            }
        if (options.isEmpty())
            throw new NoSuchElementException("type not found (missing import?): " + type);
        if (options.size() > 1)
            throw new RuntimeException("conflicting imports for type: " + type);
        return options.get(0);
    }