Skip to content

Disallow Prim modules#3291

Merged
garyb merged 2 commits intopurescript:masterfrom
parsonsmatt:matt/disallow-custom-prim
Mar 26, 2018
Merged

Disallow Prim modules#3291
garyb merged 2 commits intopurescript:masterfrom
parsonsmatt:matt/disallow-custom-prim

Conversation

@parsonsmatt
Copy link
Copy Markdown
Contributor

Fixes #3254

case getModuleName m of
mn@(ModuleName (ProperName "Prim" : _)) ->
throwError
. errorMessage'' (pure (getModuleSourceSpan m))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can just use errorMessage' and drop the pure here (these names are terrible, once we drop unpositioned errors entirely I'll give them better names 😉)

@garyb
Copy link
Copy Markdown
Member

garyb commented Mar 25, 2018

Could we add a test for a Prim submodule too? I can see from the code it should definitely work as it is now, but it'd be nice to have to help avoid regressions.

@parsonsmatt
Copy link
Copy Markdown
Contributor Author

Added another test 😄

@garyb garyb merged commit d666718 into purescript:master Mar 26, 2018
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

Successfully merging this pull request may close these issues.

3 participants