mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 12:42:02 +03:00
parent
b0e0bf17d4
commit
47d345f67a
@ -442,7 +442,11 @@ elabImplementation {vars} fc vis opts_in pass env nest is cons iname ps named im
|
||||
-- Given the method type (result of topMethType) return the mapping from
|
||||
-- top level method name to current implementation's method name
|
||||
methNameUpdate : (Name, Name, t) -> (Name, Name)
|
||||
methNameUpdate (mn, fn, _) = (UN (nameRoot mn), fn)
|
||||
methNameUpdate (UN mn, fn, _) = (UN mn, fn)
|
||||
methNameUpdate (RF mn, fn, _) = (RF mn, fn)
|
||||
methNameUpdate (NS _ mn, fn, p) = methNameUpdate (mn, fn, p)
|
||||
methNameUpdate (mn, fn, p) = (UN (nameRoot mn), fn) -- probably impossible
|
||||
|
||||
|
||||
findMethName : List (Name, Name) -> FC -> Name -> Core Name
|
||||
findMethName ns fc n
|
||||
|
@ -81,7 +81,7 @@ idrisTestsInterface = MkTestPool []
|
||||
"interface009", "interface010", "interface011", "interface012",
|
||||
"interface013", "interface014", "interface015", "interface016",
|
||||
"interface017", "interface018", "interface019", "interface020",
|
||||
"interface021"]
|
||||
"interface021", "interface022"]
|
||||
|
||||
idrisTestsLinear : TestPool
|
||||
idrisTestsLinear = MkTestPool []
|
||||
|
27
tests/idris2/interface022/DotMethod.idr
Normal file
27
tests/idris2/interface022/DotMethod.idr
Normal file
@ -0,0 +1,27 @@
|
||||
data D = MkD
|
||||
data E = MkE
|
||||
|
||||
data Proxy i = MkProxy
|
||||
|
||||
interface I i where
|
||||
(.idot) : i -> Int
|
||||
|
||||
I D where
|
||||
(.idot) _ = 0
|
||||
|
||||
interface J i where
|
||||
theInt : Proxy i -> Int
|
||||
|
||||
(.jdot) : i -> Int
|
||||
(.jdot) _ = theInt (the (Proxy i) MkProxy)
|
||||
|
||||
val : i -> Int
|
||||
val v = 10 + v .jdot
|
||||
|
||||
J D where
|
||||
theInt _ = 0
|
||||
|
||||
J E where
|
||||
theInt _ = 0
|
||||
(.jdot) _ = 1
|
||||
val _ = 2
|
8
tests/idris2/interface022/expected
Normal file
8
tests/idris2/interface022/expected
Normal file
@ -0,0 +1,8 @@
|
||||
1/1: Building DotMethod (DotMethod.idr)
|
||||
Main> 0
|
||||
Main> 0
|
||||
Main> 1
|
||||
Main> 10
|
||||
Main> 2
|
||||
Main>
|
||||
Bye for now!
|
5
tests/idris2/interface022/input
Normal file
5
tests/idris2/interface022/input
Normal file
@ -0,0 +1,5 @@
|
||||
MkD .idot
|
||||
MkD .jdot
|
||||
MkE .jdot
|
||||
val MkD
|
||||
val MkE
|
3
tests/idris2/interface022/run
Executable file
3
tests/idris2/interface022/run
Executable file
@ -0,0 +1,3 @@
|
||||
$1 --no-color --no-banner --console-width 0 DotMethod.idr < input
|
||||
|
||||
rm -rf build
|
Loading…
Reference in New Issue
Block a user