This could be a common mistake:
——————————
module foo
strategies

main =
?_(xs)
; !xs
——————————

and the error report is very unclear:
——————————
martin@logistico:~> strc -i foo.str
[ strc | info ] Compiling ‘foo.str’
error: cannot type BuildDefault(Var(““))
inferred types of subterms:
typed Var(””) as Term, PreTerm, Var
[ strc | info ] abstract syntax in ‘foo.sci.fe-cong.Stratego-Core’
[ strc | info ] concrete syntax in ‘foo.sci.fe-cong.Stratego-Core.txt’
[ strc | critical ] file /tmp/StrategoXTO0fNCidoes not satisfy format Stratego-Core
This indicates a bug in the compiler
Please notify stratego-bugs@cs.uu.nl
FILE(“/tmp/StrategoXTO0fNCi”
——————————

This could be solved by separating the syntax of overlays patterns from normal patterns (grammar mixins). Also, the compiler could of course check that a pattern does not use features that are illegal in this context. The _ in a build is another example of this.

Reported by Eric Tanter.

Submitted on 12 July 2006 at 15:07

Log in to post comments