Closed magnus-madsen closed 1 year ago
The right place to start is around here: https://github.com/flix/flix/blob/master/main/src/ca/uwaterloo/flix/language/phase/Safety.scala#L539
The goal is to reject programs that contain constraints like:
A(x) :- B(Some(x)).
which currently crash the compiler.
IMO this should be its own AST node rather than reusing pattern. Resolver is messy as a result of the reuse. See also https://github.com/flix/flix/issues/4854
@mlutze We want to allow patterns some day, we just dont have engine support yet. In that case, is it ok?
@mlutze We want to allow patterns some day, we just dont have engine support yet. In that case, is it ok?
Yes, in that case it's worth the slight weirdness in resolver.
@AStenbaek CC
The grammar for
TypedAst
for constraints has:The safety phase should check that the
terms
passed toAtom
are only variables and constants.If not, it should emit a
SafetyError
saying that such patterns are not supported.