Commit graph

369 commits

Author SHA1 Message Date
Folkert
3510bad1d5
add scaffolding 2022-03-07 20:55:40 +01:00
Folkert de Vries
ce1839133b
Merge pull request #2661 from rtfeldman/i/2541
Report invalid extension types during canonicalization
2022-03-07 16:12:04 +01:00
ayazhafiz
47e4904075 Chase aliases when checking for valid extension types 2022-03-06 22:17:58 -05:00
Folkert
ba2f9ba779
Merge remote-tracking branch 'origin/trunk' into content-flattype-copy 2022-03-06 20:52:04 +01:00
Folkert de Vries
27f367ec23
Merge pull request #2656 from rtfeldman/type-to-var-tco
Optimize type_to_variable
2022-03-06 20:44:14 +01:00
Folkert
a9c8e2dc3e
copy instead of clone Content 2022-03-06 19:07:18 +01:00
Folkert
1ff8261a66
make Content Copy 2022-03-06 18:51:23 +01:00
Folkert
29bf4195a1
make FlatType Copy 2022-03-06 18:15:26 +01:00
Folkert
41e56519ef
prevent a subs lookup by reserving a Variable 2022-03-06 18:00:25 +01:00
Folkert
8b526e4f58
clippy 2022-03-06 14:54:19 +01:00
Folkert
a37a895016
optimize tag name cache 2022-03-06 14:11:33 +01:00
Folkert de Vries
21ca144de9
formatting 2022-03-06 01:04:54 +01:00
Folkert
628f14fa7b
fix accidentally remove line 2022-03-06 00:35:45 +01:00
Folkert
6906d64ec3
optimize occurs 2022-03-05 23:45:15 +01:00
Folkert
97d9027271
improve pool_to_rank_table 2022-03-05 23:44:57 +01:00
Folkert
80956061dd
fix formatting bug in type pretty-print 2022-03-05 15:03:59 +01:00
Folkert
ec099bbdec
WIP 2022-03-02 14:46:30 +01:00
ayazhafiz
059c324268 Error reporting for type mismatches involving opaques 2022-02-27 00:10:12 -05:00
ayazhafiz
b6d7229525 Infer + checking tests for opaques 2022-02-27 00:10:12 -05:00
ayazhafiz
86aa0df661 Add constraint generation for opaque types 2022-02-27 00:10:11 -05:00
Richard Feldman
d3acf34415
Merge pull request #1591 from rtfeldman/single-quote-literal
Single Quote literal
2022-02-26 23:27:46 -05:00
ayazhafiz
a6419ccd59 Remove unnecessary debug assert 2022-02-26 15:57:57 -05:00
ayazhafiz
4742847ba9 Wrap content that is unwrapped and passes through a type alias correctly
Closes #2592
2022-02-26 15:08:27 -05:00
Brendan Hansknecht
f7c0e2ef19 Merge remote-tracking branch 'origin/trunk' into single-quote-literal 2022-02-24 10:13:39 -08:00
ayazhafiz
075c5b3eee Typo 2022-02-21 18:36:28 -05:00
ayazhafiz
90de82e295 Validation of opaques during canonicalization 2022-02-21 18:25:19 -05:00
ayazhafiz
6b53692aac Canonicalize opaque types 2022-02-20 13:47:01 -05:00
Brian Carroll
3e511acbcc Fix Wasm compile errors 2022-02-14 21:10:45 +00:00
ayazhafiz
67bb5b14f6 Examples as code block not doc 2022-02-12 21:08:23 -05:00
ayazhafiz
b8defcbc75 Use freshly-instantiated lambda variables 2022-02-12 20:03:39 -05:00
ayazhafiz
4dbdf3a58b Check that instantiated lambda set vars indeed only have vars 2022-02-12 11:32:32 -05:00
ayazhafiz
33148cb1a4 Functions are compound types 2022-02-12 10:54:57 -05:00
ayazhafiz
c064c50036 Catch illegal alias cycles more strictly
Part of #2458
2022-02-10 22:12:33 -05:00
ayazhafiz
13552b11a6 Check self- and mutually-recursive aliases in the same pass 2022-02-10 08:15:48 -05:00
Brian Carroll
c61a18a200 Use custom macros for static assertions 2022-02-09 17:16:43 +00:00
Brian Carroll
d8b76b317b repl: replace [u8; 8] with u64 in static assertions 2022-02-09 16:34:11 +00:00
Brian Carroll
8e370a32b6 repl: update some static_asserts for 32-bit compiler build 2022-02-09 16:34:11 +00:00
ayazhafiz
0d241f3c3c Only expand ErrorType::Range's type range when range unification fails 2022-02-06 15:04:13 -05:00
ayazhafiz
c80c842a93 Clippy 2022-02-06 15:04:12 -05:00
ayazhafiz
8dc92ccd97 Second pass 2022-02-06 15:04:12 -05:00
ayazhafiz
ae5766fdf5 Folkert's suggestions 2022-02-01 23:42:28 -05:00
ayazhafiz
df8113ce32 Typecheck numeric suffixes in patterns 2022-02-01 23:35:14 -05:00
ayazhafiz
9f72b2710f Run linter 2022-02-01 22:49:52 -05:00
ayazhafiz
e03592930f Typecheck numeric literals with suffixes in expressions
Part of #2350
2022-02-01 22:49:50 -05:00
ayazhafiz
4e942b3e5d Make nested datatypes into errors
I was hoping to add nested datatypes into the language, but it turns out
doing so is quite tricky and not all that useful with Roc's current
compilation model. Basically every implementation strategy I could think
of ended up requiring a uniform representation for the data layout
(or some ugly workaround). Furhermore it increased the complexity of the
checker/mono IR generator a little bit - basically, we must always pass
around the alias definitions of nested datatypes and instantiate them
at usage sites, rather than being able to unroll aliases as we currently
do during canonicalization.

So, especially because we don't support polymorphic recursion anyway, I
think it may be better to simply disallow any kind of nested datatypes
in the language. In any case, Stephanie Weirich [seems to think nested
datatypes are not needed](https://www.cis.upenn.edu/~plclub/blog/2020-12-04-nested-datatypes/).

Closes #2293
2022-01-31 22:58:01 -05:00
ayazhafiz
e7b506646b Refinements from @folkertdev review 2022-01-23 19:00:32 -05:00
ayazhafiz
b2f2fcd6a8 Collect tags from extension variables during monomorphization
Fixes #2365
2022-01-23 12:33:22 -05:00
ayazhafiz
48a3e871e8 Report self-recursive aliases at their declaration site, not in usages
Closes #2380
2022-01-22 14:26:32 -05:00
ayazhafiz
b281ea8c2c Make var_contains_content a loop 2022-01-20 18:09:04 -05:00
ayazhafiz
3342090e7b Add var_contains_content conditional function to Subs
This function checks for the existence of a content of a certain shape
on a content, or any its deep children.
2022-01-19 22:51:15 -05:00