Commit graph

120 commits

Author SHA1 Message Date
Ayaz Hafiz
0cc9ea4b05
Detect and report module names that don't match what they are used as
Prior to this commit, if you had a module structure like

```
| - A.roc
| - Dep
    | - B.roc
```

where `B.roc` was defined as

```
interface B exposes [] imports []
```

and `A.roc` was defined as

```
interface A exposes [] imports [Dep.B]
```

The compiler would hang on you. The reason is that even though we expect
`B` to be named `Dep.B` relative to `A`, that would not be enforced.

With this patch, we now enforce such naming schemes - a module must have
the namespaced name it is referenced by. Currently, we determine the
expected namespaced name by looking at how transitive dependencies of the
root module reference the module. In the future, once we have a package
ecosystem and a solid idea of "package roots", we can use the "package
root" to determine how a module should be named.

Closes #4094
2022-10-02 21:38:03 -05:00
Ayaz Hafiz
5d649666fa
Detect and report module import cycles
Closes #3557
2022-10-02 21:38:03 -05:00
Ayaz Hafiz
c67be21636
Check that module names correspond to the paths they are defined in
Closes #3440
Closes #4050
2022-10-02 21:38:02 -05:00
Ayaz Hafiz
c97cdc0753
Fix load tests 2022-09-30 13:40:35 -05:00
Folkert
6c4e225a4c
use unique temp dir 2022-09-23 17:13:15 +02:00
Ayaz Hafiz
625a86e7ed
Update test output 2022-09-21 12:30:09 -05:00
Ayaz Hafiz
7e5ff4883f
Do not qualify builtin modules with package shorthand when loading 2022-09-21 12:29:06 -05:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
Folkert
0c284f2bbf
clippy 2022-08-09 15:44:08 +02:00
Richard Feldman
e685eba42b
fix tests 2022-08-03 19:50:17 -04:00
Richard Feldman
f575807834
Merge remote-tracking branch 'origin/trunk' into outdent-infix 2022-07-16 16:08:36 -04:00
Folkert de Vries
1b1b63aad0
Merge branch 'trunk' into assoc-list-dict 2022-07-14 16:47:50 +02:00
Folkert
488a4ca730
update test 2022-07-14 08:54:42 +02:00
Richard Feldman
7908e8c176
roc format examples 2022-07-13 23:16:09 -04:00
Richard Feldman
bf63c45b46
Compute src_dir from original filename
This fixed a bug where bindgen was providing cwd() for src_dir,
but actually the src_dir should have been based on the filename.
This prevents that problem from happening in the future!
2022-07-13 12:49:06 -04:00
Folkert de Vries
f1aae6f480
Merge pull request #3476 from rtfeldman/i3469
Remove more builtins code
2022-07-10 23:06:50 +02:00
Ayaz Hafiz
7ce1dc53e0
Update load tests 2022-07-10 12:15:41 -04:00
Richard Feldman
f45e3dbb46
Fix tests 2022-07-08 18:16:08 -04:00
Richard Feldman
1364f1e518
Reproduce #3451 2022-07-08 17:25:28 -04:00
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00