Examples of asTupleType()


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

        assertFunctionBinding("test.foo");
        NType ftype = idx.lookupQnameType("test.foo");
        assertTrue(ftype instanceof NFuncType);
        NType rtype = ftype.asFuncType().getReturnType();
        assertTrue(rtype instanceof NTupleType);
        assertEquals(1, rtype.asTupleType().getElementTypes().size());
        assertEquals(ftype, rtype.asTupleType().getElementTypes().get(0));
        assertEquals("<FuncType=#1:_:<TupleType:[<#1>]>>", ftype.toString());
    }

    public void testCircularTypeXInOwnList() throws Exception {
View Full Code Here

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

        NType ftype = idx.lookupQnameType("test.foo");
        assertTrue(ftype instanceof NFuncType);
        NType rtype = ftype.asFuncType().getReturnType();
        assertTrue(rtype instanceof NTupleType);
        assertEquals(1, rtype.asTupleType().getElementTypes().size());
        assertEquals(ftype, rtype.asTupleType().getElementTypes().get(0));
        assertEquals("<FuncType=#1:_:<TupleType:[<#1>]>>", ftype.toString());
    }

    public void testCircularTypeXInOwnList() throws Exception {
        String src = index(
View Full Code Here

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

        NType iterType = NNode.resolveExpr(iter, s);

        if (iterType.isListType()) {
            bind(s, target, iterType.asListType().getElementType());
        } else if (iterType.isTupleType()) {
            bind(s, target, iterType.asTupleType().toListType().getElementType());
        } else {
            NBinding ent = iterType.getTable().lookupAttr("__iter__");
            if (ent == null || !ent.getType().isFuncType()) {
                if (!iterType.isUnknownType()) {
                    iter.addWarning("not an iterable type: " + iterType);
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.