Examples of FunType


Examples of org.yinwang.pysonar.types.FunType

    @NotNull
    @Override
    public Type transform(@NotNull State s) {
        State env = s.getForwarding();
        FunType fun = new FunType(this, env);
        fun.table.setParent(s);
        fun.table.setPath(s.extendPath(name.id));
        fun.setDefaultTypes(resolveList(defaults, s));
        Analyzer.self.addUncalled(fun);
        Binding.Kind funkind;

        if (isLamba) {
            return fun;
        } else {
            if (s.stateType == State.StateType.CLASS) {
                if ("__init__".equals(name.id)) {
                    funkind = Binding.Kind.CONSTRUCTOR;
                } else {
                    funkind = Binding.Kind.METHOD;
                }
            } else {
                funkind = Binding.Kind.FUNCTION;
            }

            Type outType = s.type;
            if (outType instanceof ClassType) {
                fun.setCls((ClassType) outType);
            }

            Binder.bind(s, name, fun, funkind);
            return Type.CONT;
        }
View Full Code Here

Examples of org.yinwang.yin.value.FunType

    @Override
    public Value typecheck(Scope s) {
        // evaluate and cache the properties in the closure
        Scope properties = propertyForm == null ? null : Declare.typecheckProperties(propertyForm, s);
        FunType ft = new FunType(this, properties, s);
        TypeChecker.self.uncalled.add(ft);
        return ft;
    }
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.