diff options
| author | Vincent Laporte | 2018-11-16 13:24:54 +0000 |
|---|---|---|
| committer | Vincent Laporte | 2018-11-27 09:44:32 +0000 |
| commit | 23fcb09d934bf77fe58f232d2c246a81fc76591f (patch) | |
| tree | 2a618992d0e83001b53e87f8c50378f15a85fb52 /doc | |
| parent | b2ed1bffb7601f6bcaf3a73c110a2783451a6e26 (diff) | |
[Typeclasses] Warn when RHS of `:>` is not a class
This introduces the warning “not-a-class” in the “typeclasses” category.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/sphinx/addendum/type-classes.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst index 15a55d9e72..882798205b 100644 --- a/doc/sphinx/addendum/type-classes.rst +++ b/doc/sphinx/addendum/type-classes.rst @@ -260,6 +260,12 @@ preorder can be used instead. This is very similar to the coercion mechanism of ``Structure`` declarations. The implementation simply declares each projection as an instance. +.. warn:: Ignored instance declaration for “@ident”: “@term” is not a class + + Using this ``:>`` syntax with a right-hand-side that is not itself a Class + has no effect (apart from emitting this warning). In particular, is does not + declare a coercion. + One can also declare existing objects or structure projections using the Existing Instance command to achieve the same effect. |
