Examples of asUnionType()


Examples of org.python.indexer.types.NType.asUnionType()

            "x = y");
        NType xtype = idx.lookupQnameType("test.x");
        assertTrue(xtype instanceof NUnionType);

        // Jump through some hoops to allow for either order in the union.
        Set<NType> types = xtype.asUnionType().getTypes();
        assertEquals(2, types.size());
        NType[] array = types.toArray(new NType[2]);
        boolean array0List = array[0] instanceof NListType;
        boolean array1List = array[1] instanceof NListType;
View Full Code Here

Examples of org.python.indexer.types.NType.asUnionType()

    public void setAttr(Scope s, NType v) throws Exception {
        setType(new NUnknownType());

        NType targetType = resolveExpr(target, s);
        if (targetType.isUnionType()) {
            targetType = targetType.asUnionType().firstKnownNonNullAlternate();
            if (targetType == null) {
                return;
            }
        }
View Full Code Here

Examples of org.python.indexer.types.NType.asUnionType()

        if (this == Indexer.idx.moduleTable) {
            if (ret.isModuleType()) {
                return ret;
            }
            if (ret.isUnionType()) {
                for (NType t : ret.asUnionType().getTypes()) {
                    NType realType = t.follow();
                    if (realType.isModuleType()) {
                        return realType;
                    }
                }
View Full Code Here

Examples of org.python.indexer.types.NType.asUnionType()

            return;
        }
        NBinding nb = bindings.get(0);
        NType t = nb.followType();
        if (t.isUnionType()) {
            t = t.asUnionType().firstKnownNonNullAlternate();
            if (t == null) {
                return;
            }
        }
        NType tt = t.follow();
View Full Code Here

Examples of org.python.indexer.types.NType.asUnionType()

        NModuleType mtype = null;
        NType thisType = getType();
        if (thisType.isModuleType()) {
            mtype = thisType.asModuleType();
        } else if (thisType.isUnionType()) {
            for (NType u : thisType.asUnionType().getTypes()) {
                if (u.isModuleType()) {
                    mtype = u.asModuleType();
                    break;
                }
            }
View Full Code Here

Examples of org.python.indexer.types.NType.asUnionType()

            List<Entry> kids = null;

            if (nb.getKind() == NBinding.Kind.CLASS) {
                NType realType = nb.followType();
                if (realType.isUnionType()) {
                    for (NType t : realType.asUnionType().getTypes()) {
                        if (t.isClassType()) {
                            realType = t;
                            break;
                        }
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.