Skip to content

Don't use the Module(...) constructor to create a module #2683

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

asinghvi17
Copy link
Collaborator

On the advice of the compiler team, we should step away from using the Module(name) constructor and instead eval in a module via an Expr.

This simply changes the way that happens. Fortunately we have the module GC code already so that should flag us if something is going wrong.

This currently evals the module to Main, but there's no reason it couldn't eval to somewhere else.

@mortenpi
Copy link
Member

This currently evals the module to Main, but there's no reason it couldn't eval to somewhere else.

It looks like Module(m) puts it into Main too, right? There's quite a bit of potentially fragile code that handles the module name, so I think it's best we keep in it Main.

Copy link
Collaborator

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like a good idea to me, but the test failures seem concerning :-(

@asinghvi17
Copy link
Collaborator Author

Yeah, not sure why the tests failed, but they magically turned green on the last commit. Might have been an intermittent thing, we'll see now I suppose

@fingolfin
Copy link
Collaborator

It turned green because you left no code changes in :-). I.e. this PR now only modifies the CHANGELOG (resulting in a merge conflict...)

@asinghvi17
Copy link
Collaborator Author

Ah no! I thought that would revert the commit, not the file 😅

@asinghvi17
Copy link
Collaborator Author

Hmm, it looks like wrapping here somehow changed printing for errors and vectors? Maybe it's the module declaration bringing in Base?

A lot of the errors seem fine to me, some are concerning though.

@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Added anchor links to admonition blocks, making it possible to create direct links to specific admonitions. ([#2505], [#2676])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changelog changes seem wrong, duplicating some existing entries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants