Skip to content

Commit c493d93

Browse files
committed
Do not compress callable
1 parent e9fa72e commit c493d93

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

synth/semantic/evaluator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import ABC, abstractmethod
2-
from typing import Any, Dict, List, Set
2+
from typing import Any, Dict, List, Set, Callable
33

44
from synth.syntax.program import Constant, Function, Primitive, Program, Variable
55

@@ -54,6 +54,9 @@ def compress(self, program: Program) -> Program:
5454
self.use_cache = False
5555
value = self.eval(program, [])
5656
self.use_cache = before
57+
# Cancel compression of callable
58+
if isinstance(value, Callable):
59+
return Function(program.function, args)
5760
tval = __tuplify__(value)
5861
if tval in self._dsl_constants:
5962
return self._dsl_constants[tval]

0 commit comments

Comments
 (0)