mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-10-04 01:17:40 +03:00
commit
a849b974ca
@ -278,7 +278,8 @@ modContextOf mname me =
|
||||
let localIface = lmInterface lm
|
||||
localNames = lmNamingEnv lm
|
||||
|
||||
loadedPublicDecls = map getPublicDecls
|
||||
-- XXX: do we want only public ones here?
|
||||
loadedDecls = map (ifDefines . lmInterface)
|
||||
$ getLoadedModules (meLoadedModules me)
|
||||
|
||||
params = ifParams localIface
|
||||
@ -286,13 +287,14 @@ modContextOf mname me =
|
||||
{ mctxParams = if Map.null params then NoParams
|
||||
else FunctorParams params
|
||||
, mctxExported = ifsPublic (ifNames localIface)
|
||||
, mctxDecls = mconcat (ifDefines localIface : loadedPublicDecls)
|
||||
, mctxDecls = mconcat (ifDefines localIface : loadedDecls)
|
||||
, mctxNames = localNames
|
||||
, mctxNameDisp = R.toNameDisp localNames
|
||||
}
|
||||
`mplus`
|
||||
do lm <- lookupSignature mname me
|
||||
let localNames = lmNamingEnv lm
|
||||
-- XXX: do we want only public ones here?
|
||||
loadedDecls = map (ifDefines . lmInterface)
|
||||
$ getLoadedModules (meLoadedModules me)
|
||||
pure ModContext
|
||||
@ -302,12 +304,6 @@ modContextOf mname me =
|
||||
, mctxNames = localNames
|
||||
, mctxNameDisp = R.toNameDisp localNames
|
||||
}
|
||||
where getPublicDecls :: LoadedModule -> IfaceDecls
|
||||
getPublicDecls lm =
|
||||
do let allDecls = ifDefines (lmInterface lm)
|
||||
publicNames = ifsPublic (ifNames (lmInterface lm))
|
||||
publicDecls = filterIfaceDecls (`Set.member` publicNames) allDecls
|
||||
publicDecls
|
||||
|
||||
|
||||
|
||||
|
@ -772,7 +772,7 @@ lookupVar x =
|
||||
Just a -> pure (ExtVar a)
|
||||
Nothing ->
|
||||
do mp <- IM $ asks iVars
|
||||
panic "lookupVar" $ [ "Undefined vairable"
|
||||
panic "lookupVar" $ [ "Undefined variable"
|
||||
, show x
|
||||
, "IVARS"
|
||||
] ++ map (show . debugShowUniques . pp) (Map.keys mp)
|
||||
|
@ -1,5 +0,0 @@
|
||||
module a where
|
||||
|
||||
private
|
||||
|
||||
property x = True
|
@ -1,3 +0,0 @@
|
||||
module b where
|
||||
|
||||
import a
|
@ -1,7 +0,0 @@
|
||||
:m a
|
||||
x
|
||||
:m b
|
||||
x
|
||||
:check x
|
||||
:check a::x
|
||||
:check
|
@ -1,17 +0,0 @@
|
||||
Loading module Cryptol
|
||||
Loading module Cryptol
|
||||
Loading module a
|
||||
True
|
||||
Loading module Cryptol
|
||||
Loading module a
|
||||
Loading module b
|
||||
|
||||
[error] at issue1621.icry:4:1--4:2
|
||||
Value not in scope: x
|
||||
|
||||
[error] at issue1621.icry:5:8--5:9
|
||||
Value not in scope: x
|
||||
|
||||
[error] at issue1621.icry:6:8--6:12
|
||||
Value not in scope: a::x
|
||||
There are no properties in scope.
|
5
tests/issues/issue1649/A.cry
Normal file
5
tests/issues/issue1649/A.cry
Normal file
@ -0,0 +1,5 @@
|
||||
// A.cry
|
||||
module A where
|
||||
|
||||
submodule B = BFunctor where
|
||||
type BTy = ()
|
9
tests/issues/issue1649/BFunctor.cry
Normal file
9
tests/issues/issue1649/BFunctor.cry
Normal file
@ -0,0 +1,9 @@
|
||||
// BFunctor.cry
|
||||
module BFunctor where
|
||||
|
||||
import interface BInterface as BI
|
||||
|
||||
type BTy = BI::BTy
|
||||
|
||||
b : BTy -> ()
|
||||
b _ = ()
|
4
tests/issues/issue1649/BInterface.cry
Normal file
4
tests/issues/issue1649/BInterface.cry
Normal file
@ -0,0 +1,4 @@
|
||||
// BInterface.cry
|
||||
interface module BInterface where
|
||||
|
||||
type BTy : *
|
5
tests/issues/issue1649/Test.cry
Normal file
5
tests/issues/issue1649/Test.cry
Normal file
@ -0,0 +1,5 @@
|
||||
// Test.cry
|
||||
module Test where
|
||||
|
||||
import A as A
|
||||
import submodule A::B as B
|
2
tests/issues/issue1649/issue1649.icry
Normal file
2
tests/issues/issue1649/issue1649.icry
Normal file
@ -0,0 +1,2 @@
|
||||
:l Test.cry
|
||||
B::b ()
|
7
tests/issues/issue1649/issue1649.icry.stdout
Normal file
7
tests/issues/issue1649/issue1649.icry.stdout
Normal file
@ -0,0 +1,7 @@
|
||||
Loading module Cryptol
|
||||
Loading module Cryptol
|
||||
Loading interface module BInterface
|
||||
Loading module BFunctor
|
||||
Loading module A
|
||||
Loading module Test
|
||||
()
|
Loading…
Reference in New Issue
Block a user