on master help sign in
Fix regression with making class bodies
6011227Edwin Brady
idris.cabal+4
@@ -541,6 +541,10 @@ Extra-source-files:
541 test/interactive010/expected
541 test/interactive010/expected
542 test/interactive010/input
542 test/interactive010/input
543 test/interactive010/run
543 test/interactive010/run
544+ test/interactive011/expected
545+ test/interactive011/input
546+ test/interactive011/run
547+ test/interactive011/*.idr
544
548
545 test/io001/run
549 test/io001/run
546 test/io001/*.idr
550 test/io001/*.idr
src/Idris/CaseSplit.hs+1−1
@@ -362,7 +362,7 @@ getClause :: Int -- ^ line number that the type is declared on
362 -> Idris String
362 -> Idris String
363getClause l fn un fp
363getClause l fn un fp
364 = do i <- getIState
364 = do i <- getIState
365− case lookupCtxt fn (idris_classes i) of
365+ case lookupCtxt un (idris_classes i) of
366 [c] -> return (mkClassBodies i (class_methods c))
366 [c] -> return (mkClassBodies i (class_methods c))
367 _ -> do ty_in <- getInternalApp fp l
367 _ -> do ty_in <- getInternalApp fp l
368 let ty = case ty_in of
368 let ty = case ty_in of
test/interactive011/expectednew file+3
@@ -0,0 +1,3 @@
1+ show x = ?Show_rhs_1
2+ showPrec d x = ?Show_rhs_2
3+append [] _ = ?append_rhs_1
test/interactive011/inputnew file+2
@@ -0,0 +1,2 @@
1+:ac 5 Show
2+:ac 7 append
test/interactive011/interactive011.idrnew file+11
@@ -0,0 +1,11 @@
1+import Data.Vect
2+
3+data Foo = Bar | Baz
4+
5+instance Show Foo where
6+
7+append : Vect n a -> Vect m a -> Vect (n + m) a
8+append (x :: xs) ys = ?append_rhs_2
9+
10+
11+
test/interactive011/runnew file+3
@@ -0,0 +1,3 @@
1+#!/usr/bin/env bash
2+idris --quiet interactive011.idr < input
3+rm -f *.ibc