STR-97: Check if strategy actual parameters are typed correctly
———————————-
module foo
imports list-cons tuple-cons
strategiesmain =
foo(!1)foo(s : (a -> a) -> a ) =
!2
———————————-Compile with -O 2 to prevent inlining
martin@logistico:~> strc -i foo.str -O 2
compiling foo.str
front-end succeeded: user 0.14 system 0.11
optimization succeeded: user 0.01 system 0.02
back-end succeeded: user 0.05 system 0.05
foo.c: In functionmain_0_0': foo.c:40: warning: passing arg 1 of
foo_1_0’ from incompatible pointer type
C compilation succeeded: user 0.07 system 0.01
—–
compilation succeeded: user 0.27 system 0.19
—————————————-This issue is related to STR-17 (Check for invalid number of term arguments). That issue is difficult to solve because the Stratego compiler does not have a proper type checker. A use of an SVar is not related to its target, which might be an higher order argument of a function. In issue STR-17, it is ok to use ‘bar’ as an argument to a higher order strategy, but not to apply ‘bar’ to a term.
Submitted on 28 May 2004 at 13:08
Issue Log
STR-97, martin:
This requires more work (see type checker)
Log in to post comments