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

Scoping of module names in staged functor parameters #10

Open
stedolan opened this issue Dec 12, 2017 · 1 comment
Open

Scoping of module names in staged functor parameters #10

stedolan opened this issue Dec 12, 2017 · 1 comment

Comments

@stedolan
Copy link
Owner

Due to how staging is currently implemented for functors, telescoped scopes are broken (i.e. the first argument to a functor is not in scope in the module type of the second, so sharing constraints don't work properly)

@OlivierNicole
Copy link

Scoping is also broken in signatures. Consider the following example:

type 'a t

module type M = sig
  val x : 'a t
end

when preprocessed with ppx_stage, results in a scoping error. Adding the flag -dsource to make clear the source of the problem:

[@@@ocaml.ppx.context
  {
    tool_name = "ppx_driver";
    include_dirs = [];
    load_path = [];
    open_modules = [];
    for_package = None;
    debug = false;
    use_threads = false;
    use_vmthreads = false;
    recursive_types = false;
    principal = false;
    transparent_modules = false;
    unboxed_types = false;
    unsafe_string = false;
    cookies = [("library-name", "tpf_staged")]
  }]
module Staged_206014691 =
  struct
    let modcontext''_ = Ppx_stage.Internal.empty_modcontext
    module type M  = sig val x : 'a t end
  end
type 'a t
module type M  = sig val x : 'a t end
File "lib/failure.ml", line 4, characters 13-14:
4 |   val x : 'a t
                 ^
Error: Unbound type constructor t

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

2 participants