diff options
| author | Inari Listenmaa <inari.listenmaa@gmail.com> | 2020-06-16 09:50:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-16 09:50:05 +0200 |
| commit | aa9b4d06ba343e9b0dd9cd2269e42c76f6cd0b4e (patch) | |
| tree | 3cc0754956d94907f44cbf81444fdd5612acc594 /doc/errors/gluing.md | |
| parent | fff19f31af79956da08deb0eedd85dde63620f9f (diff) | |
| parent | de8cc02ba58d11957defdc89b6755eeb0b548fde (diff) | |
Merge pull request #55 from inariksit/error-messages
Improvements in common error messages
Diffstat (limited to 'doc/errors/gluing.md')
| -rw-r--r-- | doc/errors/gluing.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/errors/gluing.md b/doc/errors/gluing.md new file mode 100644 index 000000000..111f8406c --- /dev/null +++ b/doc/errors/gluing.md @@ -0,0 +1,27 @@ +## unsupported token gluing `foo + bar` + +There was a problem in an expression using +, e.g. `foo + bar`. +This can be due to two causes, check which one applies in your case. + +1. You are trying to use + on runtime arguments. Even if you are using +`foo + bar` in an oper, make sure that the oper isn't called in a +linearization that takes arguments. Both of the following are illegal: + + lin Test foo bar = foo.s + bar.s -- explicit + in a lin + lin Test foo bar = opWithPlus foo bar -- the oper uses + + +2. One of the arguments in `foo + bar` is a bound variable +from pattern matching a string, but the cases are non-exhaustive. +Example: + case "test" of { + x + "a" => x + "b" -- no applicable case for "test", so x = ??? + } ; + +You can fix this by adding a catch-all case in the end: + { x + "a" => x + "b" ; + _ => "default case" } ; + +3. If neither applies to your problem, submit a bug report and we +will update the error message and this documentation. + + https://github.com/GrammaticalFramework/gf-core/issues |
