Edwin Brady
f2dff5cae4
Normalise holes in error messages
...
The solved holes may not outlive the error, so normalise before throwing
so that they can be displayed properly.
2019-06-30 17:23:19 +01:00
Edwin Brady
7998b27d66
Use exact->inexact when casting to doubles
...
Otherwise things may look like rationals, which is probably not what we
want in general
2019-06-30 16:46:09 +01:00
Edwin Brady
f37da6c5b7
Start adding tests for TypeDD book
...
Also detailing any changes needed to the code. Added primitives for
Doubles, and repl/replWith to get Chapter 2 code to work.
2019-06-30 15:50:58 +01:00
Edwin Brady
eddb23d108
Need to save postponed names in ttc too
...
Flag these when searching names for references
2019-06-30 12:49:11 +01:00
Edwin Brady
ae777b8dcb
Add parameters blocks
2019-06-29 23:55:17 +01:00
Edwin Brady
2f4cdf857d
Make typecase on -> work
2019-06-29 22:43:06 +01:00
Edwin Brady
17c862fe00
Add parse error tests from Blodwen
2019-06-29 21:37:30 +01:00
Edwin Brady
f9ea1ff329
Updating typecase, add tests
2019-06-29 21:32:19 +01:00
Edwin Brady
7aa8a71f8f
Fix loading of hints, and add test
...
Need to add by full name, due to ordering of loading (the name it's
attached to may not be resolved yet!). This doesn't seem to cause any
performance problems but we can revisit if it does.
2019-06-29 20:51:48 +01:00
Edwin Brady
e463a2864a
Add a couple more tests
2019-06-29 20:03:00 +01:00
Edwin Brady
a65d1efa38
Throw error if case type is not inferred
...
This is probably quite rare to want, but we could consider putting this
under a delayOnFailure
2019-06-29 19:39:11 +01:00
Edwin Brady
99dac56e1e
Make sure matches are not too specific
...
i.e. if an argument has a polymorphic type, we shouldn't allow a
concrete type in its place
2019-06-29 19:28:04 +01:00
Edwin Brady
cda87a9c16
Fix coverage checker issue
...
Don't use the type of a scrutinee to restrict possible patterns, because
it might have been refined by a Rig0 argument that has a missing case.
Instead, generate all the possible cases and check that the generated
ones are impossible (there's no obvious change in performance)
2019-06-29 16:41:26 +01:00
Edwin Brady
39836f3cd0
Fix instantiation in pattern unification
...
There was an optimisation that wasn't valid, and it turns out it doesn't
have any useful effect anyway.
2019-06-28 19:41:25 +01:00
Edwin Brady
9b44839c57
Add test for eta
2019-06-28 12:43:55 +01:00
Edwin Brady
e9a3167e2f
Even more tests
...
Small change needed to fix one - assume given implicits which are of the
form x@_ arise from types. It's a bit of a hack but I don't think
there's any need for anything more complicated.
2019-06-27 20:19:00 +01:00
Edwin Brady
110a7461fc
More tests from Blodwen
2019-06-27 19:33:02 +01:00
Edwin Brady
82ceedb84e
Add linearity tests
2019-06-27 19:28:14 +01:00
Edwin Brady
192a06ea5d
Merge branch 'master' of github.com:edwinb/Idris2
2019-06-27 19:19:02 +01:00
Edwin Brady
b0cad15c65
Refine dot pattern rules
...
Only valid if unifying the pattern at the end doesn't solve any
metavariables. Also when elaborating applications of fromInteger etc to
constants on the LHS we need to be in expression mode, then reduce the
result later.
2019-06-27 19:16:33 +01:00
Edwin Brady
211de419bb
Fix environments for nested names
...
This was a slight difference from Blodwen that wasn't accounted for -
there might be lets in the nested environment, so when building the
expanded application type, make sure we go under them
2019-06-27 15:26:18 +01:00
Edwin Brady
d053a18977
Set fresh name counter on loading Main ttc
...
Make sure this is the counter from the right namespace, or we might get
name clashes at the REPL
2019-06-27 14:47:47 +01:00
Edwin Brady
0d01257ede
Set fresh name counter on loading Main ttc
...
Make sure this is the counter from the right namespace, or we might get
name clashes at the REPL
2019-06-27 13:42:49 +01:00
Edwin Brady
ce78abaaef
Build and save references for metavars too
...
This wasn't necessary before, since we always inlined, but since we can
now postpone things longer and don't always inline until much later, we
need to know what names everything refers to earlier.
2019-06-27 09:01:59 +01:00
Edwin Brady
2cd81a9eb0
More tests moved over...
2019-06-25 21:50:48 +01:00
Edwin Brady
3eda2494bf
Add error message tests
2019-06-25 21:46:28 +01:00
Edwin Brady
7b504e7a9e
More Chez tests
2019-06-25 21:27:46 +01:00
Edwin Brady
69199639cf
Fix Nat hack
...
And add chez scheme section to tests, with one initial test
2019-06-25 14:05:54 +01:00
Edwin Brady
bf64f843aa
A bit more totality checking polish
...
Need to check for 'assert_total' in getRefs, and get Inf and Lazy the
right way around!
2019-06-25 12:57:49 +01:00
Edwin Brady
0b4f4ec46d
Fix naming issue in totality checker
...
Also added a new test
2019-06-25 10:26:14 +01:00
Edwin Brady
5caa277cbe
Fix some totality issues, add tests
...
These are related to the change in naming and metavariables, mostly
2019-06-25 00:42:52 +01:00
Edwin Brady
e68b9134e7
Calculate parameter positions in types
2019-06-24 19:31:25 +01:00
Edwin Brady
fb7190b337
Add first batch of totality checking tests
2019-06-24 18:14:07 +01:00
Edwin Brady
b1acceb870
Add a simple lazy Inf test
2019-06-24 18:08:32 +01:00
Edwin Brady
32583d608d
More interface tests
...
and a small fix for the generation of method types which was okay for
Blodwen, but not here
2019-06-24 18:04:43 +01:00
Edwin Brady
e9514f3c22
Add first interface tests
2019-06-24 17:36:55 +01:00
Edwin Brady
e6292acdf0
Finish adding interactive tests from Blodwen
...
This involved implementing the 'TryWithImplicits' hack for allowing
unbound implicits in types with case blocks
2019-06-24 16:23:32 +01:00
Edwin Brady
1e2fcb8ccd
Fix small error is as patterns
...
Also added new interactive test
2019-06-24 15:30:36 +01:00
Edwin Brady
7a47c9ae0c
Add a couple of interactive tests
2019-06-24 15:16:49 +01:00
Edwin Brady
881426e62a
Add initial CONTRIBUTING.md
2019-06-24 15:06:27 +01:00
Edwin Brady
18f269bbef
Add some notes
...
Mostly copied from Blodwen and brought up to date (more or less).
2019-06-24 13:05:19 +01:00
Edwin Brady
af9dc69c61
Add record tests from Blodwen
2019-06-24 12:44:34 +01:00
Edwin Brady
aebb8ddfde
Need to update full names in metadata
...
We need to do this as we're building, not just on saving, because we
might immediately use it when searching for full definitions.
2019-06-24 09:51:02 +01:00
Edwin Brady
0a15c2cda1
Pay attention to visibility of names
...
Name lookup and search should ignore names which aren't visible (that
is, private names in another namespace)
2019-06-24 00:57:22 +01:00
Edwin Brady
67a43e0000
Check names are visible/public
2019-06-24 00:12:58 +01:00
Edwin Brady
40ea548a65
Cache whether a local is let bound, if we can
...
Since lookup up a binding can be expensive in a big environment, and we
only need to reduce it if it turns out to be a let, caching it can be a
noticeable win
2019-06-23 23:12:27 +01:00
Edwin Brady
9c902de5d1
Fix case tree compiler for coverage checking
...
We can't refine by a name in Rig0 because we can't assume it covers all
possibilities, so only refine by them at the end, at which point we
check that there's only one case left (otherwise we have to match on it,
which is not allowed for an erased thing)
2019-06-23 20:36:06 +01:00
Edwin Brady
9350122e1b
filterM was quadratic time. Oops!
...
Some care is still needed with ! notation because it lifts out of the
branches in if blocks and it really shouldn't...
2019-06-23 16:04:32 +01:00
Edwin Brady
1a333a481b
Process name directives from TTC
2019-06-23 12:52:37 +01:00
Edwin Brady
f77ef8154b
No longer any need for NameRefs
2019-06-22 22:36:15 +01:00