mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-03 06:02:54 +00:00
Handle explicit builtin imports with empty exposing lists
Also includes related style suggestions by Ayaz on #6658
This commit is contained in:
parent
66bf955a6e
commit
d952d5576a
3 changed files with 92 additions and 59 deletions
|
|
@ -1146,6 +1146,41 @@ fn explicit_builtin_import() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_builtin_import_empty_exposing() {
|
||||
let modules = vec![(
|
||||
"Main.roc",
|
||||
indoc!(
|
||||
r#"
|
||||
interface Main exposes [main] imports []
|
||||
|
||||
import Bool exposing []
|
||||
|
||||
main = Bool.true
|
||||
"#
|
||||
),
|
||||
)];
|
||||
let err = multiple_modules("empty_exposing_builtin_import", modules).unwrap_err();
|
||||
assert_eq!(
|
||||
err,
|
||||
indoc!(
|
||||
r"
|
||||
── EXPLICIT BUILTIN IMPORT in tmp/empty_exposing_builtin_import/Main.roc ───────
|
||||
|
||||
The builtin Bool was imported here:
|
||||
|
||||
3│ import Bool exposing []
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Builtins are imported automatically, so you can remove this import.
|
||||
|
||||
Tip: Learn more about builtins in the tutorial:
|
||||
<https://www.roc-lang.org/tutorial#builtin-modules>
|
||||
"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_builtin_type_import() {
|
||||
let modules = vec![(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue