Unchecked purity
Closed this issue · 1 comments
TheSignPainter98 commented
Describe the bug
Purity is not checked when evaluating functions. This is in three main areas.
- Impure functions may be passed to pure ones
- Impure functions may be called from pure ones
- Pure functions may be called without saving their results
To Reproduce
Attempt to compile the following.
module test
p :: int -> int
p x:
return x
#
f :: (@int -> int) -> int
f g:
@p(1)
return g(1)
#
Expected behaviour
The above should fail to compile on all three counts.
Environment (please complete the following information):
- OS: Ubuntu
- Emperor version: unreleased
Additional context
N/A
TheSignPainter98 commented
This was resolved in #23