Implicitly import Prelude in a module called Prelude (#22228)
Previously, the following program (T22228a) would not compile:
module Prelude where
foo = True
This was because the base Prelude was not implicitly imported when the module is
also named Prelude
.
To make the above program compile (and not recursively import itself), the
parser now inserts import "base" Prelude
whenever the module's name is
Prelude
, unless the user:
- explicitly imports base Prelude themselves, or
- explicitly does not import the base Prelude with NoImplicitPrelude.
To avoid confusion, the user should ideally do either (1) or (2) above—I've added a warning if the user does neither.
Fixes Prelude is not imported in a module called Prelude (#22228 - closed).