Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new module system] Incorrect declaration order after type checking #1385

Closed
yav opened this issue Jul 15, 2022 · 1 comment
Closed

[new module system] Incorrect declaration order after type checking #1385

yav opened this issue Jul 15, 2022 · 1 comment

Comments

@yav
Copy link
Member

yav commented Jul 15, 2022

Example:

  x : [8]

submodule G where
  import interface submodule S 
  y = x + 1

submodule F where
  import interface submodule S as A

  submodule P where x = 8
  submodule M = submodule G { submodule P }
  import submodule M
  z = 1 + y
 
submodule Arg where
  x = 5
 
submodule FA = submodule F { submodule Arg }
import submodule FA

This results in:

/* Not recursive */
Main::Arg::x : {a} (Literal 5 a) => a
Main::Arg::x = \{a} (Literal 5 a) -> Cryptol::number 5 a <>

/* Not recursive */
Main::F::A::x : [8]
Main::F::A::x = Main::Arg::x [8] <>

/* Not recursive */
Main::FA::z : [8]
Main::FA::z =
  (Cryptol::+) [8] <> (Cryptol::number 1 [8] <>) Main::FA::M::y

/* Not recursive */
Main::FA::M::y : [8]
Main::FA::M::y =
  (Cryptol::+) [8] <> Main::G::S::x (Cryptol::number 1 [8] <>)

/* Not recursive */
Main::G::S::x : [8]
Main::G::S::x = Main::FA::P::x [8] <>

/* Not recursive */
Main::FA::P::x : {a} (Literal 8 a) => a
Main::FA::P::x = \{a} (Literal 8 a) -> Cryptol::number 8 a <>

Note that Main::FA::M::y is used before it is defined.

yav added a commit that referenced this issue Jul 15, 2022
@yav
Copy link
Member Author

yav commented Jul 26, 2022

This is fixed on the module system branch

@yav yav closed this as completed Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant