Commit Graph

55 Commits

Author SHA1 Message Date
Edwin Brady
26e6e1ed82 Calculate compile time references even in case
If we don't do this, we don't look inside case blocks to check they
cover, and so we might miss coverage errors in nested case blocks.
Fixes #202
2020-05-30 21:53:29 +01:00
Edwin Brady
ecaa73bad5 Update test result
Not sure why this didn't fail for me locally... possibly libraries out
of sync.
2020-05-30 17:30:31 +01:00
Edwin Brady
3f914889b8 Add visibility rules on types
Can't export a type which refers to a private name. This has caught a
couple of visibility errors in the libraries, code and tests, so they've
been updated too.
2020-05-30 17:03:15 +01:00
Edwin Brady
e1dbcad2fc Make a start on reflection
Don't get too excited yet - I want this in so that it doesn't get too
out of sync, but I still have to think about exactly how it's going to
work in practice.
2020-05-29 22:40:29 +01:00
Edwin Brady
d869eb666c Experiment %syntactic flag on with
This means it abstracts over the value syntactically, rather than by
value, and can significantly speed up elaboration where large types are
involved, at a cost of being less general. Try it if "with" is slow.

There are more flags we want on with (well, at least one: "proof")
2020-05-29 16:39:11 +01:00
Edwin Brady
aad56c723f
Merge pull request #191 from edwinb/totality
Totality checking
2020-05-28 16:28:06 +01:00
Edwin Brady
8c5d5055fa Update scheme
Changing the prelude totality default means we need to update the scheme
to be able to cope with its new meaning
2020-05-28 16:05:08 +01:00
Tim Süberkrüb
42a1522a3b Try to make Windows happy with backslashes 2020-05-28 16:42:56 +02:00
Edwin Brady
2223d50c3a Skip totality check on case blocks and MNs
These are checked as part of checking the top level names
2020-05-28 15:32:46 +01:00
Tim Süberkrüb
c2dfe7de7f Add popen and pclose from Idris 1 2020-05-28 12:58:03 +02:00
Niklas Larsson
696db7f58f
Merge pull request #169 from andylokandy/pathcom
Use Path in the compiler
2020-05-27 21:23:29 +02:00
Edwin Brady
c88bf7af8d Fix import loading
This was taking too long, and adding too many things, because it was
going too deep in the name of having everything accessible at the REPL
and for the compiler. So, it's done a bit differently now, only chasing
everything on a "full" load (i.e., final load at the REPL)

This has some effects:
+ As systems get bigger, load time gets better (on my machine, checking
  Idris.Main now takes 52s from scratch, down from 76s)
+ You might find import errors that you didn't previously get, because
  things were being imported that shouldn't have been. The new way is
  correct!

An unfortunate effect is that sometimes you end up getting "undefined
name" errors even if you didn't explicitly use the name, because
sometimes a module uses a name from another module in a type, which then
gets exported, and eventually needs to be reduced. This mostly happens
because there is a compile time check that should be done which I
haven't implemented yet. That is, public export definitions should only
be allowed to use names that are also public export. I'll get to this
soon.
2020-05-27 15:49:03 +01:00
Jan de Muijnck-Hughes
8b062f47cc Allow cli given option overriding for ipkg cmds.
As it was in Idris1 being able to override some, or introduce new, options to an Idris IPKG is beneficial. For example, generate code for multiple codegens from a single source.

Overridable options are:

+ `--quiet`
+ `--verbose`
+ `--timing`
+ `--dumpcases <file>`
+ `--dumplifted <file>`
+ `--dumpvmcode <file>`
+ `--debug-elab-check`
2020-05-26 14:41:09 +01:00
Jan de Muijnck-Hughes
54fd78a956 Fixed fragility of ipkg file parsing.
+ Explicitly check if an IPKG has the correct suffix.
+ Add missing case that could return a malformed error message.
2020-05-26 14:41:09 +01:00
Jan de Muijnck-Hughes
68a4ad2e1c New test for detecting overridable options for IPKG commands. 2020-05-26 14:41:09 +01:00
andylokandy
712a4df140 Gather the straw isWindowss 2020-05-26 17:59:14 +08:00
Jinwoo Lee
4a52a84113 update golden files 2020-05-25 10:06:52 -07:00
Edwin Brady
81e9214c6f Fix build
Showing a hole should show normalised types for the locals
2020-05-25 16:45:33 +01:00
Edwin Brady
bbd3986cfc
Merge pull request #153 from ohad/ide-protocol-holes
Ide protocol holes
2020-05-25 15:43:52 +01:00
Edwin Brady
3120fcb84a Allow _ for names in pi binders
This is mostly to make it easier to write linear function types without
having to invent names for everything, which might be noisy. Also it
improves the display of linear function types when the name isn't used
in the scope.
2020-05-25 13:14:51 +01:00
Ohad Kammar
f4797be529 Merge branch 'master' of github.com:idris-lang/Idris2 into ide-protocol-holes 2020-05-25 11:51:39 +01:00
Ohad Kammar
92eaa247a6 Refactor FoundHoles : REPLResult to carry more structured information about holes 2020-05-25 10:38:22 +01:00
Edwin Brady
227bd3b457
Merge pull request #119 from idris-lang/idemode
[ refactor ] Idris.IDEMode.CaseSplit
2020-05-25 09:09:37 +01:00
Edwin Brady
9970c66417 Warn on detecting unreachable patterns
I don't know how complete this is, but it certainly detects some of the
most obvious cases which are most likely to be bugs.

While I'm at it, this is as good a time as any to add a general way of
reporting warnings, similar to the way of reporting errors.
2020-05-25 00:16:49 +01:00
Edwin Brady
498421a236 All functions now need to be covering by default
This has caught a couple of things in the Idris 2 code base itself. Some
tests needed partial annotations too.
2020-05-24 19:58:20 +01:00
Edwin Brady
3ec8631480 More coverage checking fixes
Still a couple of things to resolve in coverage and totality checking
before we can switch on %default, so don't expect quite the right
behaviour just yet. More progress though!

Also working on this has caught a few totality errors in the Idris 2
code base that Idris 1 missed... so these are fixed on the way.
2020-05-24 18:33:43 +01:00
Niklas Larsson
709ca9d152 Unbreak Windows bootstrap 2020-05-23 20:00:15 +02:00
Guillaume ALLAIS
53a7cf36a1 [ fix ] preserve spacing during update 2020-05-23 14:41:44 +01:00
Niklas Larsson
4f97e0822b
Fix comparison in gen_expected.sh 2020-05-23 15:34:41 +02:00
Guillaume ALLAIS
9737f863a6 [ typo ] in test coverage007 2020-05-23 13:38:33 +01:00
Edwin Brady
1524b865c0 Remove needless %cg directives
These now refer to an old library file that is no longer used since the
network library was ported to the new FFI
2020-05-23 13:06:39 +01:00
Edwin Brady
aeea2b80c9
Merge pull request #109 from ziman/with-disamb
`with` expressions for name disambiguation
2020-05-23 12:22:35 +01:00
Niklas Larsson
61ec7757ed
Merge pull request #107 from melted/fix_win_tests
Fix windows tests
2020-05-23 13:08:41 +02:00
Edwin Brady
65e3f63598 Make sure literals are normalise on LHS
The hack (optimisation?) to normalise integer literals when below some
threshold is fine on the RHS, but on the LHS causes problems since we
need them in normal form for pattern matching. Fixes #112
2020-05-23 11:48:15 +01:00
Edwin Brady
eb3cba5f85 Better checking for empty types
This improves coverage checking, because it can now see that things like
(Z = S x) and (x = S x) are empty. Previously, it only checked that all
possible constructors had a disjoint index. Now, it looks for matches
and checks for disjointness in the matches, which catches a lot more
things especially with equality.
2020-05-23 11:03:54 +01:00
Niklas Larsson
2160d7297c Fix chez014 2020-05-23 11:08:25 +02:00
Niklas Larsson
99f407f1ab Simplify chez017 after changing test runner 2020-05-23 11:08:25 +02:00
Niklas Larsson
755a10056a Be lenient with slashes and backslashes on Windows 2020-05-23 11:08:25 +02:00
Niklas Larsson
09ea6af22f Fix chez017 for Windows 2020-05-23 11:08:25 +02:00
Matus Tejiscak
74dd653fc5 Apply the patch from idris2-boot. 2020-05-22 20:26:10 +02:00
Edwin Brady
69ec410890 Add AllGuarded flag for functions
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.
2020-05-22 17:27:18 +01:00
Edwin Brady
6d946fed7f Evaluate with tcinline under Delay
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.
2020-05-22 13:30:07 +01:00
Edwin Brady
b0b3861498
Merge pull request #94 from melted/win_bootstrap
Windows support
2020-05-21 19:19:51 +01:00
Edwin Brady
02ac3c9945 Forgot to add some test files! 2020-05-21 17:22:30 +01:00
Edwin Brady
941c8b1ab5 Point bootstrap tests at the right place
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
2020-05-21 17:11:12 +01:00
Edwin Brady
bd093e9cba Propagate totality options on methods
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)
2020-05-21 16:04:22 +01:00
Niklas Larsson
d50bb099ea Windows support 2020-05-21 15:13:06 +02:00
Edwin Brady
0f724fbc7f Report errors on totality check failure
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)
2020-05-21 13:08:19 +01:00
Edwin Brady
8291c8bbeb Add runtime error for unhandled cases
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.
2020-05-21 10:54:22 +01:00
Edwin Brady
4d7f122375
Merge pull request #7 from chrrasmussen/fix-chez016
Fix chez016 test
2020-05-20 11:48:06 +01:00