This is added to functions which are guaranteed to be productive. The
check is currently very conservative - just added when every clause is
constructor headed (or headed by an AllGuarded function), and there are
no other function applications.
This allows a function to be inlined for totality checking purposes
only. So, for example, (>>=) might be a function, but if it evaluates to
something constructor guarded in some context, then it might still be
productive.
It needs to take into account that solving other names might cause
unification errors to succeed, so only give up if there's conflicting
concrete constructors
If we never evaluate under Delay at all, we won't inline interface
methods, which means productive things defined in an interface can never
be today. So, make sure to set the tcinline flag before quoting the
Delayed closure.
If we're delaying because of a unification failure, there's no point in
trying again. This can massively speed up (or maybe I should say "unslow
down") error reporting if there's ambiguity because the elaborator won't
be exploring some paths which can never succeed.
Run once ignoring errors to make progress on interfaces/determining
arguments, then again in full. Second step isn't needed since it was
just covering up an earlier bug.
This means that some errors under lots of delays are reported quicker,
though I still haven't completely got to the bottom of that one.
In which delayed elaborators which arise during other delayed
elaborators might not get run, leading to a hole, so if there's an error
in the delayed elaborator you might just see that there's a hole still
to resolve.
The down side of this, at least in the example that prompted it, is that
it can take a while for an unresolvable ambiguity error to be reported
while it explores everything. even if there's only a few possibilities.
I will try to think of something...
I don't know why this works for me locally but not on travis, although
it is harder for me to be sure this machine is completely clean! So the
easiest way to find out if this fixes the problem is probably just to
try it...
We also need to separate building the runtests binary from running the
tests, because runtests refers to the boostrap libraries, and the tests
refer to the newly built libraries.
This worked locally, using inconsistent TTC versions for the bootstrap
version and new version, but let's see what it does on a clean machine
I think the tests are using the libraries from the bootstrap Idris 2, not
the just built Idris 2, so if the ttc formats aren't idential the tests
won't work. Let's see if that theory is correct...
As in Idris 1 - if an interface declares a method as total or covering,
then all implementations have to satisfy that.
Temporarily turn off %default directive again, at least until totality
checking works as it should (this is probably better than removing it
from various places because I'll forget to put them back)
This means temporarily removing some '%default total' from the libraries
and tests, since the input for codata checking isn't right yet (it needs
appropriate use of inlining)
Should have done this ages ago, it was much easier than I expected...
this adds an explicit error clause before running the pattern match
compiler for runtime case trees, but only if the coverage checker finds
there are missing cases.