@NotNull
    @Override
    public Type transform(@NotNull State s) {
        Type locType = null;
        if (locator instanceof Attribute) {
            locType = transformExpr(((Attribute) locator).target, s);
            if (!locType.isUnknownType()) {
                s = locType.table;
            }
        }

        FunType fun = new FunType(this, s);
        fun.table.setParent(s);
        fun.setDefaultTypes(resolveList(defaults, s));

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

        if (locType instanceof ClassType || locType instanceof ModuleType || Analyzer.self.staticContext) {
            fun.setClassMethod(true);
            s.insertTagged(name.id, "class", name, fun, Binding.Kind.CLASS_METHOD);
            fun.table.setPath(s.extendPath(name.id, "."));
        } else {
            s.insert(name.id, name, fun, Binding.Kind.METHOD);
            fun.table.setPath(s.extendPath(name.id, "#"));
        }
        Analyzer.self.addUncalled(fun);
        return Type.CONT;
    }