Commit graph

6322 commits

Author SHA1 Message Date
satotake
3a890f46d3 Add x86_64 Int lt support for gen_dev
Close #2033
2021-11-20 06:17:22 +00: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
Folkert
3ab09322e0 don't copy variables that are the same in every subs 2021-11-20 02:15:26 +01:00
Folkert
594e754e1e manually track visited varibles in deep_copy_var_to 2021-11-20 01:39:57 +01:00
Folkert
2bccc2d28d optimize instantiate_rigids_help 2021-11-20 01:26:17 +01:00
Folkert
d0abab1876 fix the updater; it did not really work?! 2021-11-20 01:24:17 +01:00
Folkert
497bc2db02 make instantiate_rigids_help use a loop/stack 2021-11-20 00:24:46 +01:00
Richard Feldman
49fd864a2f
Merge pull request #1996 from rtfeldman/add_list_all
adding List.all
2021-11-19 17:55:04 -05:00
Folkert
991420731d rename function 2021-11-19 23:49:09 +01:00
Folkert
38b5e627d7 enforce only one direct host-exposed specialization 2021-11-19 23:30:35 +01:00
Folkert
88a1a0fd40 rename variable 2021-11-19 23:30:12 +01:00
Folkert
71d2f1c17c generate error message when main has unresolved type variables 2021-11-19 23:21:29 +01:00
Folkert
555a28af83 remove SolvedType from mono/src/ir.rs 2021-11-19 22:58:24 +01:00
Folkert
dddfddc835 refactor 2021-11-19 22:38:24 +01:00
Folkert
640b4e2d0b cleanup 2021-11-19 22:25:37 +01:00
Folkert
74f073b3c6 use HostSpecializations from file.rs 2021-11-19 22:20:50 +01:00
Folkert
5d9d2b7fea add specialize_host_specializations 2021-11-19 22:15:02 +01:00
Folkert
6baffdf6fb try using solvedtype in HostSpecializations (will remove this later) 2021-11-19 22:08:03 +01:00
Folkert
41806e4093 fix specialize_variable call 2021-11-19 21:32:47 +01:00
Folkert
b43101fca5 add specialize_suspended 2021-11-19 21:30:14 +01:00
Folkert
992016d2ae add HostSpecializations 2021-11-19 21:29:34 +01:00
Folkert
4a454eeb25 remove all_pending_specializations from file.rs State 2021-11-19 21:27:05 +01:00
Folkert
eb9bb12725 bumpalo type_to_var 2021-11-19 19:48:51 +01:00
Folkert
22fb31198a use bumpalo to reduce allocations in deep_copy_var_to 2021-11-19 19:21:26 +01:00
Folkert
2fe8537177 clean up deep_copy_var_help 2021-11-19 19:01:27 +01:00
Folkert
19de25426c update mono test 2021-11-19 19:01:03 +01: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
rvcas
8544782173 feat: trying some things out 2021-11-18 18:52:55 -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