mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-11-11 03:34:13 +03:00
Fix borrowed type check
Actually a borrowed type can be used as many times as you like, it's just the names inside the pattern that can't be used without being lent first!
This commit is contained in:
parent
b37dcbeab3
commit
ddf9779f87
@ -271,7 +271,7 @@ checkUnique borrowed ctxt env tm
|
||||
then put ((n, (LendOnly, NullType)) : ns)
|
||||
else put ((n, (Once, UniqueType)) : ns)
|
||||
UType NullType -> do ns <- get
|
||||
put ((n, (LendOnly, NullType)) : ns)
|
||||
put ((n, (Many, NullType)) : ns)
|
||||
UType AllTypes -> do ns <- get
|
||||
put ((n, (Once, AllTypes)) : ns)
|
||||
_ -> return ()
|
||||
|
@ -1,3 +1,3 @@
|
||||
|
||||
steal : {a : UniqueType} -> Borrowed a -> a
|
||||
steal x = x
|
||||
steal (Read x) = x
|
||||
|
Loading…
Reference in New Issue
Block a user