Commit graph

5748 commits

Author SHA1 Message Date
Folkert
c4ec9aa898 working mono 2021-11-20 23:25:30 +01:00
Folkert de Vries
25a64f4a57
Merge pull request #2032 from rtfeldman/joshuawarner32/internal-linkage
Use Internal linkage to keep roc function symbols in the final binary
2021-11-20 12:30:41 +01:00
Brendan Hansknecht
ec0704a0b3
Merge pull request #2021 from rtfeldman/dev-backend-num-neq
add x86_64 Int neq support for gen_dev
2021-11-19 22:33:12 -08:00
Joshua Warner
45f9f800ef Use Internal linkage instead of Private to keep roc function symbols in the final binary 2021-11-19 21:32:34 -08:00
satotake
b7ee16afc8 add set_reg64 help 2021-11-20 05:21:33 +00:00
satotake
a5d56092e3
Merge pull request #2024 from rtfeldman/dev-backend-num-sub-test
Add assembly generation test to x86_64 subtraction instruction
2021-11-20 14:09:28 +09:00
Richard Feldman
49fd864a2f
Merge pull request #1996 from rtfeldman/add_list_all
adding List.all
2021-11-19 17:55:04 -05:00
satotake
7f27f9b854 Add assembly generation test to x86_64 subtraction instruction 2021-11-19 17:00:59 +00:00
Folkert
0f029f58c9 Merge remote-tracking branch 'origin/trunk' into storage-subs 2021-11-19 17:51:18 +01:00
Folkert
2810c1fc52 clean up instantiate_rigids 2021-11-19 17:51:05 +01:00
satotake
e064deca76 add x86_64 Int neq support for gen_dev 2021-11-19 16:50:41 +00:00
Folkert
e54344ac8b storage subs for External specializations 2021-11-19 17:10:30 +01:00
Michael Downey
df91f63af8 changing const_zero to const_int 2021-11-19 07:24:07 -05:00
Folkert
206c8889df Use StorageSubs for pending specializations 2021-11-19 13:22:17 +01:00
Folkert de Vries
71a46166d2
Merge pull request #2017 from rtfeldman/i/1513
Add test case for former issue
2021-11-19 10:27:53 +01:00
Folkert de Vries
71233fcfc1
Merge pull request #2012 from rtfeldman/i/1714
Take syntactic sugar into account when reporting errors
2021-11-19 10:26:24 +01:00
Folkert de Vries
a58c999d3e
Merge pull request #2008 from rtfeldman/improve-typo-suggestions
Minor improvements to "did you mean?" suggestions provided for missing identifiers
2021-11-19 10:24:52 +01:00
ayazhafiz
d29d536990 Don't test on gen-dev yet 2021-11-18 23:22:50 -05:00
ayazhafiz
0c046476a9 Add test case for former issue
Closes #1513
2021-11-18 22:06:33 -05:00
ayazhafiz
fe99d20be5 Apply review suggestions 2021-11-18 21:49:37 -05:00
ayazhafiz
5bfc52cd3b Remove Sugar enum and inline single variant into CalledVia 2021-11-18 21:23:41 -05:00
ayazhafiz
8b7217847d Rename additional stale roc_module::operator refs and format 2021-11-18 20:20:33 -05:00
ayazhafiz
8a60162a1e Rename roc_module::operator -> roc_module::called_via
A bit of a nit, but this file is now more general than just keeping
track of operator methods.
2021-11-18 20:20:33 -05:00
ayazhafiz
30955a1eb8 Take syntactic sugar into account when reporting errors
Previously, a program like

```roc
word = "word"

if True then 1 else "\(word) is a word"
```

would report an error like

```
── TYPE MISMATCH ───────────────────────────────────────────────────────────────

This `if` has an `else` branch with a different type from its `then` branch:

3│  if True then 1 else "\(word) is a word"
                        ^^^^^^^^^^^^^^^^^^

This concat all produces:

    Str

but the `then` branch has the type:

    Num a

I need all branches in an `if` to have the same type!
```

but this is a little bit confusing, since the user shouldn't have to
know (or care) that string interpolations are equivalent to
concatenations under the current implementation.

Indeed we should make this fully transparent. We now word the error
message by taking into account the way calls are made. To support the
case shown above, we introduce the `CalledVia::Sugar` variant to
represent the fact that some calls may be the result of desugaring the
surface syntax.

This commit also demonstrates the usage of `CalledVia` to produce better
error messages where we use binary comparison operators like `<`. There
are more improvements we can make here for all `CalledVia` variants, but
this is a good starting point to demonstrate the usage of the new
procedure.

Closes #1714
2021-11-18 20:20:33 -05:00
Folkert
9126169fcb StorageSubs 2021-11-18 23:02:47 +01:00
Michael Downey
d11bb93539
Merge branch 'trunk' into add_list_all 2021-11-18 16:09:24 -05:00
Michael Downey
12f7d4b458 fixing format 2021-11-18 16:04:38 -05:00
Folkert de Vries
a4fc813ca3
Merge pull request #2002 from rtfeldman/builtins-list-intersperse
Add builtin `List.intersperse`
2021-11-18 22:00:10 +01:00
Richard Feldman
4f7935a4da
Merge pull request #2003 from rtfeldman/deep-copy-var-to
Store pending or external specializations in Subs instead of SolvedType
2021-11-18 09:10:21 -05:00
Folkert
947051749d fix typo 2021-11-18 13:17:29 +01:00
Folkert
9aca302c39 Merge remote-tracking branch 'origin/trunk' into deep-copy-var-to 2021-11-18 13:16:24 +01:00
Folkert
f99542f066 add special symbol for removed specializations 2021-11-18 13:15:00 +01:00
Michael Downey
9d587d37b4
Merge branch 'trunk' into add_list_all 2021-11-18 06:41:08 -05:00
satotake
2eae1a857b Fix comment wording 2021-11-18 11:20:37 +00:00
satotake
9aabd08953 fmt 2021-11-18 11:17:05 +00:00
satotake
ce8a88416d Merge branch 'trunk' into builtins-list-intersperse 2021-11-18 11:16:27 +00:00
satotake
7ce9f1b3bd refactor after review 2021-11-18 10:15:38 +00:00
Brian Carroll
be55582290 Enable some more gen_wasm string builtins 2021-11-18 09:59:52 +00:00
Brian Carroll
9b2f01042e Enable all Str.concat tests 2021-11-18 09:04:52 +00:00
Michael Downey
c5484a9ad3 fixing List.all on empty list to be true 2021-11-17 22:47:49 -05:00
ayazhafiz
214b8a30a9 Suggest typo fixes for non-existing module values 2021-11-17 22:40:51 -05:00
ayazhafiz
c156f61b0f Suggest tags of primitive types when an ident is misspelled
With this change, mispellings of things like `true` and `false` will
include a hint to the user that they may want to use `True` and `False`,
respectively, instead.

There are a few ways to implement this, but exposing these common tags
(which compose builtin type aliases) seems the easiest, least expensive,
and doesn't break anything for now.
2021-11-17 22:40:51 -05:00
Joshua Warner
7f5b873357 Parse _ in type annotations as an 'Inferred' type 2021-11-17 17:59:40 -08:00
Richard Feldman
91c97dbba4
Merge pull request #2006 from rtfeldman/fix-macos-builds-1968
Fix compiler builds on macOS
2021-11-17 20:17:11 -05:00
ayazhafiz
c17b9ffaa3 Fix compiler builds on macOS
`cargo build` is currently failing on trunk. #1986 added an extra
parameter to the definition of `build_zig_host_native` active for
non-macOS targets, but did not reflect that parameter in the
macOS-specific definition.

I don't think there is a good way to test against these kinds of things
without a dedicated macOS machine on the CI runner (`cargo check
--target x86_64-apple-darwin` won't work since some dependencies need
arch-specific things to be present during build time). Any suggestions
are appreciated!
2021-11-17 17:45:02 -05:00
Richard Feldman
6adbfbd245
Merge pull request #1998 from rtfeldman/roc-reporting-separate-module
Move reporting module into root.
2021-11-17 17:41:15 -05:00
Richard Feldman
380f8bceec
Merge pull request #1990 from rtfeldman/fix-dev-backend-readme-link
Fix link in gen_dev README.md
2021-11-17 17:29:19 -05:00
Brendan Hansknecht
09f030621c
Merge pull request #1992 from rtfeldman/dev-backend-num-int-negate
add x86_64 Int Num.neg support for gen_dev
2021-11-17 14:16:36 -08:00
Folkert
f9c81bffe0 make external specializations more efficient
- create fewer Subs values
- don't merge Subs if not needed
2021-11-17 23:09:20 +01:00
Folkert
0199c00936 Merge remote-tracking branch 'origin/trunk' into deep-copy-var-to 2021-11-17 22:34:46 +01:00