Skip to content

disambiguating record types defined in different files #120

Open
@johnynek

Description

@johnynek

I have some code like:

fn foo(v: Value) {
  let ty = Ty::of_value(v);
  let ident = ty.to_string();
  ...
}

And the motivation is that I am building a configuration system where I allow users to define new record types. But the issue comes when user in one file makes Foo = record() and another file makes Foo = record(). These are distinct types because they were defined in two separate files.

But the ty.to_string() in the above collides.

  1. is there currently a way I can disambiguate these two?
  2. if not, would you be open to a PR that allows inspecting the module id where the user type was defined, which should allow disambiguation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions