Fix regression with making class bodies

:ac should add a class body when given a class name, but a previous
change stopped this working. Test added to prevent similar accidents in
future.
This commit is contained in:
Edwin Brady 2015-11-14 17:41:05 +00:00
parent 70b6c862f5
commit 6011227566
6 changed files with 24 additions and 1 deletions

View File

@ -541,6 +541,10 @@ Extra-source-files:
test/interactive010/expected
test/interactive010/input
test/interactive010/run
test/interactive011/expected
test/interactive011/input
test/interactive011/run
test/interactive011/*.idr
test/io001/run
test/io001/*.idr

View File

@ -362,7 +362,7 @@ getClause :: Int -- ^ line number that the type is declared on
-> Idris String
getClause l fn un fp
= do i <- getIState
case lookupCtxt fn (idris_classes i) of
case lookupCtxt un (idris_classes i) of
[c] -> return (mkClassBodies i (class_methods c))
_ -> do ty_in <- getInternalApp fp l
let ty = case ty_in of

View File

@ -0,0 +1,3 @@
show x = ?Show_rhs_1
showPrec d x = ?Show_rhs_2
append [] _ = ?append_rhs_1

View File

@ -0,0 +1,2 @@
:ac 5 Show
:ac 7 append

View File

@ -0,0 +1,11 @@
import Data.Vect
data Foo = Bar | Baz
instance Show Foo where
append : Vect n a -> Vect m a -> Vect (n + m) a
append (x :: xs) ys = ?append_rhs_2

3
test/interactive011/run Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
idris --quiet interactive011.idr < input
rm -f *.ibc