Commit Graph

11368 Commits

Author SHA1 Message Date
Richard Feldman
f80c4affb5
Merge pull request #2014 from rtfeldman/jthegedus-patch-1
docs: fix broken link to BUILDING_FROM_SOURCE
2021-11-18 09:11:49 -05: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 de Vries
8a0cace6e4
Merge pull request #2013 from rtfeldman/wasm-str
Enable some more Wasm Str builtins
2021-11-18 13:28:06 +01: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
James Hegedus
d04982cf98
docs: fix broken link to BUILDING_FROM_SOURCE 2021-11-18 21:38:33 +11: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
ayazhafiz
d165052e64 Fix typo 2021-11-18 00:12:17 -05:00
ayazhafiz
3d601ac02d Ensuer RuntimeError::ValueNotExposed is built properly in roc_ast 2021-11-17 22:58:16 -05:00
ayazhafiz
22be349392 Remove redundant import 2021-11-17 22:48:41 -05: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
Richard Feldman
5b19337089
Merge pull request #2007 from rtfeldman/joshuawarner32/parse_type_underscore
Parse _ in type annotations as an 'Inferred' type
2021-11-17 22:38:50 -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
Richard Feldman
d2fec425e3
Add Callum Dunster and Martin Stewart to AUTHORS 2021-11-17 19:53:39 -05:00
Richard Feldman
1865d96b05
Merge pull request #2005 from rtfeldman/MartinSStewart-patch-1
Fixed "map literal" used instead of "dict literal"
2021-11-17 19:50:50 -05:00
ayazhafiz
0c124aa783 Revert "Check for compilation errors against macOS"
This reverts commit 712237998f.
2021-11-17 19:49:14 -05:00
Folkert de Vries
7a41568fcd
Merge pull request #2004 from rtfeldman/contrain_expr2_letfunction
Implement constraint generation for annotated `Expr2::FunctionDefs`
2021-11-18 00:24:51 +01:00
ayazhafiz
712237998f Check for compilation errors against macOS 2021-11-17 18:02:53 -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
Folkert
75126b09fd refactor procs.specialized 2021-11-17 22:33:24 +01:00
Richard Feldman
1d330d9147
Merge pull request #1982 from rtfeldman/joshuawarner32/parser-snapshot-testing
Convert most test_parser tests to "snapshot" tests
2021-11-17 16:01:43 -05:00
MartinSStewart
46499e4419
Fixed "map literal" used instead of "dict literal" 2021-11-17 20:56:32 +01:00
Richard Feldman
2bb007e08b
Merge pull request #1987 from rtfeldman/builtins-list-split
Add builtin `List.split`
2021-11-17 13:41:58 -05:00
Folkert de Vries
71d38ecfab
Merge pull request #2000 from rtfeldman/wasm-str-builtins
gen_wasm: Get a Str builtin working, linking to roc_alloc
2021-11-17 19:38:23 +01:00
ayazhafiz
111a835b3c Add ignored tests for annotation-only declarations in Expr2
These tests fail currently because we have not implemented type
reconstruction in the presence of annonation-only declarations, but it's
good to keep track of them for later.
2021-11-17 13:38:00 -05:00
ayazhafiz
539c737123 Implement constraint generation for annotated Expr2::FunctionDefs
This is mostly the same as the procedure for unannotated `FunctionDef`s.
The only differences are that we need to

1. note the rigid type variables that are a part of the FunctionDef
2. generate fresh type variables for the function arguments, and
   constrain them to the types of the arguments passed to us in the
   annotation

This is enough to get the constraint generation working. There are more
interesting cases that properly typecheck in the main compiler but do
not typecheck given the current state of the editor AST (see the second
test in this commit), but this is a bug due to canonicalization, not
type reconstruction.
2021-11-17 13:38:00 -05:00
ayazhafiz
9399596d86 Store rigid var names during translation of closure defs to Expr2
We ened to store the mapping of `rigid type vars -> user-declared names`
for presentation later on when we reconstruct the type of an expression
and want to pretty-print it for the user. This information is most
naturally captured on `output.introduced_variables`, as the main
compiler does so there.

We don't currently record this mapping while translating `Annotation`s
to `Annotation2`s (though we could), so we store it when we hit an
annotated expression that now needs to become an `Expr2`.
2021-11-17 13:38:00 -05:00
ayazhafiz
477ecd6c3b Store rigid type and field names as Lowercase in Expr2
Moving from storing these as slices to `Lowercase`s makes it easier to
transform to shapes we'll need later during type reconstruction, for
example a mapping of rigid type variables to their lowercase variable
names.
2021-11-17 13:38:00 -05:00
ayazhafiz
efe6a8b7c8 Pass down rigids vars for substitution during type reconstruction
Rigid vars are added to types after solutions are already found and are
only relevant for pretty printing elaborated types, so we don't keep
track of/care about their rigid names until the end of solution.
Previously we didn't provide this information in tests, though - now we
do.
2021-11-17 13:38:00 -05:00
ayazhafiz
506086e3d7 Make sure Expr2 function annotation arguments fit in a PoolVec slot
The size of a `(PatternId, Type2)` tuple is 40 bytes (4 for the
`PatternId`, 4 bytes padding, 32 for the `Type2`). This doesn't fit in
an item slot allocated by the pool, which has a max of 32 bytes. So, we
allocate the Type2 itself on the pool, and then reference its pool ID in
the resulting tuple, which lowers the total size of the tuple to 8
bytes. This is a bit wasteful, but I couldn't find a better solution
without significantly more rework.

We also reorder the Type2 and PatternId fields in the tuple to better
align with the typical `(type|type variable, pattern|expression)` tuple
structure that exists in e.g. `FunctionDef::NoAnnotation`.
2021-11-17 13:38:00 -05:00
ayazhafiz
af8fad2618 Update sizes of Type2 variants to be correct
These are outdated; the new calculations reflect the current state of
the codebase.
2021-11-17 13:38:00 -05:00
Brian Carroll
3d124b4122 Fix builtin calls for primitives 2021-11-17 16:51:42 +00:00
Brian Carroll
dbd7d9a374 Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-str-builtins 2021-11-17 16:46:01 +00:00
Brian Carroll
b5b90fb2b7 Delete unused file 2021-11-17 16:45:52 +00:00
Brian Carroll
1134b6f45c Fix test_wrapper linking bug 2021-11-17 16:45:38 +00:00