Fix parallel execution

This commit is contained in:
Richard Feldman 2025-11-17 16:48:40 -05:00
parent 3dd45a6b77
commit 3a144a304a
No known key found for this signature in database
57 changed files with 346 additions and 783 deletions

View file

@ -2995,20 +2995,19 @@ test "unify - fails on anonymous recursion" {
var env = try TestEnv.init(gpa);
defer env.deinit();
// Use Box for anonymous recursion testing
const box_var_a = try env.module_env.types.fresh();
const box_content_a = Content{
.structure = .{ .box = box_var_a },
};
try env.module_env.types.setRootVarContent(box_var_a, box_content_a);
// Create a tag union that recursively contains itself (anonymous recursion)
// This is like: a = [A a] unifying with b = [A b]
const tag_var_a = try env.module_env.types.fresh();
const tag_a = try env.mkTag("A", &[_]Var{tag_var_a});
const tag_union_a = try env.mkTagUnionClosed(&[_]Tag{tag_a});
try env.module_env.types.setRootVarContent(tag_var_a, tag_union_a.content);
const box_var_b = try env.module_env.types.fresh();
const box_content_b = Content{
.structure = .{ .box = box_var_b },
};
try env.module_env.types.setRootVarContent(box_var_b, box_content_b);
const tag_var_b = try env.module_env.types.fresh();
const tag_b = try env.mkTag("A", &[_]Var{tag_var_b});
const tag_union_b = try env.mkTagUnionClosed(&[_]Tag{tag_b});
try env.module_env.types.setRootVarContent(tag_var_b, tag_union_b.content);
const result = try env.unify(box_var_a, box_var_b);
const result = try env.unify(tag_var_a, tag_var_b);
switch (result) {
.ok => try std.testing.expect(false),

View file

@ -1476,11 +1476,9 @@ const Unifier = struct {
}) catch return error.AllocatorError;
// Create nominal List(U8) - List is from Builtin module
const list_ident = self.module_env.common.findIdent("List") orelse {
// If List ident is not found, something is wrong with the environment
// This should never happen in a properly initialized compiler
@panic("List ident not found in module environment");
};
// If List ident is not found, something is wrong with the environment
// This should never happen in a properly initialized compiler!
const list_ident = self.module_env.common.findIdent("List") orelse unreachable;
// Use the cached builtin_module_ident which represents the "Builtin" module.
const origin_module = if (self.module_lookup.get(self.module_env.builtin_module_ident)) |_|

View file

@ -766,6 +766,7 @@ pub const PackageEnv = struct {
/// Combined canonicalization and type checking function for snapshot tool
/// This ensures the SAME module_envs map is used for both phases
/// Note: Does NOT run compile-time evaluation - caller should do that separately if needed
pub fn canonicalizeAndTypeCheckModule(
gpa: Allocator,
env: *ModuleEnv,
@ -815,11 +816,6 @@ pub const PackageEnv = struct {
try checker.checkFile();
// After type checking, evaluate top-level declarations at compile time
const builtin_types_for_eval = BuiltinTypes.init(builtin_indices, builtin_module_env, builtin_module_env, builtin_module_env);
var comptime_evaluator = try eval.ComptimeEvaluator.init(gpa, env, imported_envs, &checker.problems, builtin_types_for_eval);
_ = try comptime_evaluator.evalAll();
module_envs_map.deinit();
return checker;

View file

@ -1143,9 +1143,23 @@ fn processSnapshotContent(
var maybe_expr_idx: ?Can.CanonicalizedExpr = null;
switch (content.meta.node_type) {
.file, .package, .platform, .app, .snippet => {
.file, .package, .platform, .app => {
// All file types that use canonicalizeFile() will use the combined function below
},
.snippet => {
// Snippet tests can have arbitrary content (type declarations, expressions, etc.)
// that may not work with canonicalizeFile(), so handle them separately
var module_envs = std.AutoHashMap(base.Ident.Idx, Can.AutoImportedType).init(allocator);
defer module_envs.deinit();
if (config.builtin_module) |builtin_env| {
try Can.populateModuleEnvs(&module_envs, can_ir, builtin_env, config.builtin_indices);
}
var czer = try Can.init(can_ir, &parse_ast, &module_envs);
defer czer.deinit();
try czer.canonicalizeFile();
},
.header => {
// TODO: implement canonicalize_header when available
},
@ -1244,20 +1258,44 @@ fn processSnapshotContent(
);
_ = try checker.checkExprRepl(expr_idx.idx);
break :blk checker;
} else blk: {
// For all test types that use canonicalizeFile() (file, package, platform, app, snippet),
// use the combined canonicalize+typecheck function.
// This ensures the SAME module_envs map is used for both phases (just like REPL tests)
const builtin_env = config.builtin_module orelse unreachable;
const imported_envs_const: []const *ModuleEnv = @ptrCast(builtin_modules.items);
break :blk try compile.PackageEnv.canonicalizeAndTypeCheckModule(
allocator,
can_ir,
&parse_ast,
builtin_env,
config.builtin_indices,
imported_envs_const,
);
} else switch (content.meta.node_type) {
.file, .package, .platform, .app => blk: {
// For file types, use the combined canonicalize+typecheck function.
// This ensures the SAME module_envs map is used for both phases (just like REPL tests)
const builtin_env = config.builtin_module orelse unreachable;
const imported_envs_const: []const *ModuleEnv = @ptrCast(builtin_modules.items);
break :blk try compile.PackageEnv.canonicalizeAndTypeCheckModule(
allocator,
can_ir,
&parse_ast,
builtin_env,
config.builtin_indices,
imported_envs_const,
);
},
.snippet, .statement, .header, .expr => blk: {
// For snippet/statement/header/expr tests, use old-style separate type checking (already canonicalized above)
// Note: .expr can reach here if canonicalizeExpr returned null (error during canonicalization)
var module_envs = std.AutoHashMap(base.Ident.Idx, Can.AutoImportedType).init(allocator);
defer module_envs.deinit();
if (config.builtin_module) |builtin_env| {
try Can.populateModuleEnvs(&module_envs, can_ir, builtin_env, config.builtin_indices);
}
var checker = try Check.init(
allocator,
&can_ir.types,
can_ir,
builtin_modules.items,
&module_envs,
&can_ir.store.regions,
common_idents,
);
try checker.checkFile();
break :blk checker;
},
.repl => unreachable, // Should never reach here - repl is handled earlier
};
defer solver.deinit();

View file

@ -21,17 +21,6 @@ add2 = x + 2
^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**add_var_with_spaces.md:1:8:1:18:**
```roc
add2 = x + 2
```
^^^^^^^^^^
The `crash` happened with this message:
**runtime error**
# TOKENS
~~~zig
LowerIdent,OpAssign,LowerIdent,OpPlus,Int,

View file

@ -0,0 +1,90 @@
# META
~~~ini
description=Binop omnibus - singleline - no spaces
type=expr
~~~
# SOURCE
~~~roc
Err(foo)??12>5*5 or 13+2<5 and 10-1>=16 or 12<=3/5
~~~
# EXPECTED
UNDEFINED VARIABLE - binop_omnibus__single__no_spaces.md:1:5:1:8
INVALID BOOL OPERATION - binop_omnibus__single__no_spaces.md:1:21:1:21
# PROBLEMS
**UNDEFINED VARIABLE**
Nothing is named `foo` in this scope.
Is there an `import` or `exposing` missing up-top?
**binop_omnibus__single__no_spaces.md:1:5:1:8:**
```roc
Err(foo)??12>5*5 or 13+2<5 and 10-1>=16 or 12<=3/5
```
^^^
**INVALID BOOL OPERATION**
I'm having trouble with this bool operation:
**binop_omnibus__single__no_spaces.md:1:21:**
```roc
Err(foo)??12>5*5 or 13+2<5 and 10-1>=16 or 12<=3/5
```
^^
Both sides of `and` must be _Bool_ values, but the right side is:
_Num(_size)_
Note: Roc does not have "truthiness" where other values like strings, numbers or lists are automatically converted to bools. You must do that conversion yourself!
# TOKENS
~~~zig
UpperIdent,NoSpaceOpenRound,LowerIdent,CloseRound,OpDoubleQuestion,Int,OpGreaterThan,Int,OpStar,Int,OpOr,Int,OpPlus,Int,OpLessThan,Int,OpAnd,Int,Int,OpGreaterThanOrEq,Int,OpOr,Int,OpLessThanOrEq,Int,OpSlash,Int,
EndOfFile,
~~~
# PARSE
~~~clojure
(e-binop (op "or")
(e-binop (op ">")
(e-binop (op "??")
(e-apply
(e-tag (raw "Err"))
(e-ident (raw "foo")))
(e-int (raw "12")))
(e-binop (op "*")
(e-int (raw "5"))
(e-int (raw "5"))))
(e-binop (op "and")
(e-binop (op "<")
(e-binop (op "+")
(e-int (raw "13"))
(e-int (raw "2")))
(e-int (raw "5")))
(e-int (raw "10"))))
~~~
# FORMATTED
~~~roc
Err(foo) ?? 12 > 5 * 5 or 13 + 2 < 5 and 10
~~~
# CANONICALIZE
~~~clojure
(e-binop (op "or")
(e-binop (op "gt")
(e-binop (op "null_coalesce")
(e-tag (name "Err")
(args
(e-runtime-error (tag "ident_not_in_scope"))))
(e-num (value "12")))
(e-binop (op "mul")
(e-num (value "5"))
(e-num (value "5"))))
(e-binop (op "and")
(e-binop (op "lt")
(e-binop (op "add")
(e-num (value "13"))
(e-num (value "2")))
(e-num (value "5")))
(e-num (value "10"))))
~~~
# TYPES
~~~clojure
(expr (type "Error"))
~~~

View file

@ -192,44 +192,6 @@ Is there an `import` or `exposing` missing up-top?
^^^^^^^^^^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_comprehensive.md:5:8:33:2:**
```roc
main = {
client = Http.get
parser = Json.utf8
helper = Str.trim
# Test direct module access
result1 = Json.parse
# Test aliased module access
result2 = Http.post
# Test exposed items (should work without module prefix)
result3 = get
result4 = post
# Test multiple qualified access
combined = Str.concat
(
client,
parser,
helper,
result1,
result2,
result3,
result4,
combined,
)
}
```
The `crash` happened with this message:
**runtime error**
# TOKENS
~~~zig
KwImport,LowerIdent,NoSpaceDotUpperIdent,

View file

@ -957,7 +957,7 @@ combineTrys = |jsonTry, httpStatus|
(patt (type "Error, List(Error) -> Error"))
(patt (type "Error -> Error"))
(patt (type "Error -> Error"))
(patt (type "Error, Error -> Error")))
(patt (type "Try(Error, Error), Error -> Try(Error, Error)")))
(type_decls
(alias (type "ServerConfig")
(ty-header (name "ServerConfig"))))
@ -967,5 +967,5 @@ combineTrys = |jsonTry, httpStatus|
(expr (type "Error, List(Error) -> Error"))
(expr (type "Error -> Error"))
(expr (type "Error -> Error"))
(expr (type "Error, Error -> Error"))))
(expr (type "Try(Error, Error), Error -> Try(Error, Error)"))))
~~~

View file

@ -233,17 +233,6 @@ advancedParser = |parserConfig, input| Json.Parser.parseWith(parserConfig, input
^^^^^^^^^^^^^^^^^^^^^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_type_annotations.md:21:10:21:28:**
```roc
config = Json.defaultConfig
```
^^^^^^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
# TOKENS
~~~zig
KwImport,LowerIdent,NoSpaceDotUpperIdent,KwAs,UpperIdent,KwExposing,OpenSquare,UpperIdent,Comma,UpperIdent,CloseSquare,
@ -655,15 +644,15 @@ combineTrys = |result1, result2|
(defs
(patt (type "Error -> Error"))
(patt (type "Str -> Error"))
(patt (type "Error -> Error"))
(patt (type "Error -> Try(Error, Error)"))
(patt (type "Error"))
(patt (type "Error, Str -> Error"))
(patt (type "Error, Error -> Error")))
(patt (type "Try(a, err), Try(b, err) -> Try((a, b), err)")))
(expressions
(expr (type "Error -> Error"))
(expr (type "Str -> Error"))
(expr (type "Error -> Error"))
(expr (type "Error -> Try(Error, Error)"))
(expr (type "Error"))
(expr (type "Error, Str -> Error"))
(expr (type "Error, Error -> Error"))))
(expr (type "Try(a, err), Try(b, err) -> Try((a, b), err)"))))
~~~

View file

@ -177,61 +177,6 @@ parser = Json.Parser.Advanced.NonExistent.create
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_unresolved_qualified.md:5:8:5:31:**
```roc
main = Json.NonExistent.method
```
^^^^^^^^^^^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
**COMPTIME EVAL ERROR**
This definition could not be evaluated at compile time:
**can_import_unresolved_qualified.md:16:10:16:28:**
```roc
result = Json.prase("test")
```
^^^^^^^^^^^^^^^^^^
The evaluation failed with error:
**TypeMismatch**
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_unresolved_qualified.md:19:10:19:31:**
```roc
config = Unknown.Module.config
```
^^^^^^^^^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_unresolved_qualified.md:22:10:22:28:**
```roc
client = Http.invalidMethod
```
^^^^^^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_unresolved_qualified.md:25:10:25:49:**
```roc
parser = Json.Parser.Advanced.NonExistent.create
```
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
# TOKENS
~~~zig
KwImport,LowerIdent,NoSpaceDotUpperIdent,

View file

@ -35,17 +35,6 @@ main = MyJson.decode
^^^^^^^^^^^^^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**can_import_with_alias.md:3:8:3:21:**
```roc
main = MyJson.decode
```
^^^^^^^^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
# TOKENS
~~~zig
KwImport,LowerIdent,NoSpaceDotUpperIdent,KwAs,UpperIdent,

View file

@ -0,0 +1,75 @@
# META
~~~ini
description=Multiline list with type mismatch
type=expr
~~~
# SOURCE
~~~roc
[
42,
"hello world",
100
]
~~~
# EXPECTED
INCOMPATIBLE LIST ELEMENTS - can_list_multiline_mismatch.md:2:5:2:5
# PROBLEMS
**INCOMPATIBLE LIST ELEMENTS**
The first two elements in this list have incompatible types:
**can_list_multiline_mismatch.md:2:5:**
```roc
42,
"hello world",
```
^^
^^^^^^^^^^^^^
The first element has this type:
_Num(_size)_
However, the second element has this type:
_Str_
All elements in a list must have compatible types.
Note: You can wrap each element in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags>
# TOKENS
~~~zig
OpenSquare,
Int,Comma,
StringStart,StringPart,StringEnd,Comma,
Int,
CloseSquare,
EndOfFile,
~~~
# PARSE
~~~clojure
(e-list
(e-int (raw "42"))
(e-string
(e-string-part (raw "hello world")))
(e-int (raw "100")))
~~~
# FORMATTED
~~~roc
[
42,
"hello world",
100,
]
~~~
# CANONICALIZE
~~~clojure
(e-list
(elems
(e-num (value "42"))
(e-string
(e-literal (string "hello world")))
(e-num (value "100"))))
~~~
# TYPES
~~~clojure
(expr (type "List(Error)"))
~~~

View file

@ -0,0 +1,67 @@
# META
~~~ini
description=Heterogeneous nested list causes type mismatch
type=expr
~~~
# SOURCE
~~~roc
[[], [1], ["hello"]]
~~~
# EXPECTED
INCOMPATIBLE LIST ELEMENTS - can_list_nested_heterogeneous.md:1:6:1:6
# PROBLEMS
**INCOMPATIBLE LIST ELEMENTS**
The second and third elements in this list have incompatible types:
**can_list_nested_heterogeneous.md:1:6:**
```roc
[[], [1], ["hello"]]
```
^^^ ^^^^^^^^^
The second element has this type:
_List(Num(_size))_
However, the third element has this type:
_List(Str)_
All elements in a list must have compatible types.
Note: You can wrap each element in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags>
# TOKENS
~~~zig
OpenSquare,OpenSquare,CloseSquare,Comma,OpenSquare,Int,CloseSquare,Comma,OpenSquare,StringStart,StringPart,StringEnd,CloseSquare,CloseSquare,
EndOfFile,
~~~
# PARSE
~~~clojure
(e-list
(e-list)
(e-list
(e-int (raw "1")))
(e-list
(e-string
(e-string-part (raw "hello")))))
~~~
# FORMATTED
~~~roc
NO CHANGE
~~~
# CANONICALIZE
~~~clojure
(e-list
(elems
(e-empty_list)
(e-list
(elems
(e-num (value "1"))))
(e-list
(elems
(e-string
(e-literal (string "hello")))))))
~~~
# TYPES
~~~clojure
(expr (type "List(Error)"))
~~~

View file

@ -8,22 +8,9 @@ type=file
helper = |x| x + 1
~~~
# EXPECTED
MISSING MAIN! FUNCTION - default_app_no_main.md:1:1:1:19
NIL
# PROBLEMS
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**default_app_no_main.md:1:1:1:19:**
```roc
helper = |x| x + 1
```
^^^^^^^^^^^^^^^^^^
NIL
# TOKENS
~~~zig
LowerIdent,OpAssign,OpBar,LowerIdent,OpBar,LowerIdent,OpPlus,Int,

View file

@ -11,7 +11,6 @@ main! = |arg1, arg2| {
~~~
# EXPECTED
UNUSED VARIABLE - default_app_wrong_arity.md:1:16:1:20
MAIN! SHOULD TAKE 1 ARGUMENT - default_app_wrong_arity.md:1:1:3:2
# PROBLEMS
**UNUSED VARIABLE**
Variable `arg2` is not used anywhere in your code.
@ -25,21 +24,6 @@ main! = |arg1, arg2| {
^^^^
**MAIN! SHOULD TAKE 1 ARGUMENT**
`main!` is defined but has the wrong number of arguments. `main!` should take 1 argument.
Found `2` arguments.
Change it to:
`main! = |arg| { ... }`
**default_app_wrong_arity.md:1:1:3:2:**
```roc
main! = |arg1, arg2| {
arg1
}
```
# TOKENS
~~~zig
LowerIdent,OpAssign,OpBar,LowerIdent,Comma,LowerIdent,OpBar,OpenCurly,

View file

@ -41,17 +41,6 @@ print_msg! = |msg| Stdout.line!(msg)
^^^^^^^^^^^^
**COMPTIME EVAL ERROR**
This definition could not be evaluated at compile time:
**effectful_with_effectful_annotation.md:9:9:9:36:**
```roc
main! = print_msg!("Hello, world!")
```
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The evaluation failed with error:
**TypeMismatch**
# TOKENS
~~~zig
KwApp,OpenSquare,LowerIdent,CloseSquare,OpenCurly,LowerIdent,OpColon,KwPlatform,StringStart,StringPart,StringEnd,CloseCurly,

View file

@ -11,7 +11,6 @@ mo|%
PARSE ERROR - fuzz_crash_001.md:1:1:1:3
PARSE ERROR - fuzz_crash_001.md:1:3:1:4
PARSE ERROR - fuzz_crash_001.md:1:4:1:5
MISSING MAIN! FUNCTION - fuzz_crash_001.md:1:1:1:5
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -46,20 +45,6 @@ mo|%
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_001.md:1:1:1:5:**
```roc
mo|%
```
^^^^
# TOKENS
~~~zig
LowerIdent,OpBar,OpPercent,

View file

@ -20,7 +20,6 @@ PARSE ERROR - fuzz_crash_002.md:1:21:1:23
PARSE ERROR - fuzz_crash_002.md:1:23:1:24
PARSE ERROR - fuzz_crash_002.md:1:24:1:25
MALFORMED TYPE - fuzz_crash_002.md:1:6:1:7
MISSING MAIN! FUNCTION - fuzz_crash_002.md:1:1:1:25
# PROBLEMS
**UNEXPECTED TOKEN IN TYPE ANNOTATION**
The token **;** is not expected in a type annotation.
@ -153,20 +152,6 @@ modu:;::::::::::::::le[%
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_002.md:1:1:1:25:**
```roc
modu:;::::::::::::::le[%
```
^^^^^^^^^^^^^^^^^^^^^^^^
# TOKENS
~~~zig
LowerIdent,OpColon,MalformedUnknownToken,OpDoubleColon,OpDoubleColon,OpDoubleColon,OpDoubleColon,OpDoubleColon,OpDoubleColon,OpDoubleColon,LowerIdent,OpenSquare,OpPercent,

View file

@ -13,7 +13,6 @@ PARSE ERROR - fuzz_crash_003.md:1:1:1:2
PARSE ERROR - fuzz_crash_003.md:1:3:1:4
PARSE ERROR - fuzz_crash_003.md:1:4:1:6
PARSE ERROR - fuzz_crash_003.md:1:6:1:6
MISSING MAIN! FUNCTION - fuzz_crash_003.md:1:1:1:6
# PROBLEMS
**UNCLOSED STRING**
This string is missing a closing quote.
@ -69,20 +68,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_003.md:1:1:1:6:**
```roc
= "te
```
^^^^^
# TOKENS
~~~zig
OpAssign,StringStart,StringPart,StringEnd,

View file

@ -9,7 +9,6 @@ F
~~~
# EXPECTED
PARSE ERROR - fuzz_crash_004.md:2:1:2:1
MISSING MAIN! FUNCTION - fuzz_crash_004.md:1:1:1:2
# PROBLEMS
**PARSE ERROR**
Type applications require parentheses around their type arguments.
@ -34,20 +33,6 @@ Other valid examples:
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_004.md:1:1:1:2:**
```roc
F
```
^
# TOKENS
~~~zig
UpperIdent,

View file

@ -9,7 +9,6 @@ modu
~~~
# EXPECTED
PARSE ERROR - fuzz_crash_005.md:1:1:1:5
MISSING MAIN! FUNCTION - fuzz_crash_005.md:1:1:1:5
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -22,20 +21,6 @@ modu
^^^^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_005.md:1:1:1:5:**
```roc
modu
```
^^^^
# TOKENS
~~~zig
LowerIdent,

View file

@ -11,7 +11,6 @@ ff8.8.d
PARSE ERROR - fuzz_crash_007.md:1:1:1:4
PARSE ERROR - fuzz_crash_007.md:1:4:1:6
PARSE ERROR - fuzz_crash_007.md:1:6:1:8
MISSING MAIN! FUNCTION - fuzz_crash_007.md:1:1:1:8
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -46,20 +45,6 @@ ff8.8.d
^^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_007.md:1:1:1:8:**
```roc
ff8.8.d
```
^^^^^^^
# TOKENS
~~~zig
LowerIdent,NoSpaceDotInt,NoSpaceDotLowerIdent,

View file

@ -12,7 +12,6 @@ ASCII CONTROL CHARACTER - :0:0:0:0
PARSE ERROR - fuzz_crash_008.md:1:1:1:2
PARSE ERROR - fuzz_crash_008.md:1:3:1:4
PARSE ERROR - fuzz_crash_008.md:1:4:1:5
MISSING MAIN! FUNCTION - fuzz_crash_008.md:1:1:1:5
# PROBLEMS
**ASCII CONTROL CHARACTER**
ASCII control characters are not allowed in Roc source code.
@ -52,20 +51,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_008.md:1:1:1:5:**
```roc
||1
```
^^^^
# TOKENS
~~~zig
OpBar,OpBar,Int,

View file

@ -19,7 +19,6 @@ PARSE ERROR - fuzz_crash_009.md:1:3:1:4
PARSE ERROR - fuzz_crash_009.md:1:4:1:5
PARSE ERROR - fuzz_crash_009.md:1:5:1:6
PARSE ERROR - fuzz_crash_009.md:2:6:2:7
MISSING MAIN! FUNCTION - fuzz_crash_009.md:1:2:6:12
# PROBLEMS
**UNCLOSED STRING**
This string is missing a closing quote.
@ -86,24 +85,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_009.md:1:2:6:12:**
```roc
f{o,
]
foo =
"onmo %
```
# TOKENS
~~~zig
LowerIdent,OpenCurly,LowerIdent,Comma,

View file

@ -18,7 +18,6 @@ PARSE ERROR - fuzz_crash_010.md:1:2:1:3
PARSE ERROR - fuzz_crash_010.md:1:3:1:4
PARSE ERROR - fuzz_crash_010.md:1:4:1:5
PARSE ERROR - fuzz_crash_010.md:2:6:2:7
MISSING MAIN! FUNCTION - fuzz_crash_010.md:1:1:5:35
# PROBLEMS
**ASCII CONTROL CHARACTER**
ASCII control characters are not allowed in Roc source code.
@ -91,23 +90,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_010.md:1:1:5:35:**
```roc
H{o,
 ]
foo =
"on (string 'onmo %')))
```
# TOKENS
~~~zig
UpperIdent,OpenCurly,LowerIdent,Comma,

View file

@ -15,7 +15,6 @@ PARSE ERROR - fuzz_crash_012.md:1:4:1:5
PARSE ERROR - fuzz_crash_012.md:1:5:1:6
PARSE ERROR - fuzz_crash_012.md:1:6:1:16
PARSE ERROR - fuzz_crash_012.md:1:16:1:17
MISSING MAIN! FUNCTION - fuzz_crash_012.md:1:1:1:17
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -94,20 +93,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_012.md:1:1:1:17:**
```roc
||(|(l888888888|
```
^^^^^^^^^^^^^^^^
# TOKENS
~~~zig
OpBar,OpBar,NoSpaceOpenRound,OpBar,NoSpaceOpenRound,LowerIdent,OpBar,

View file

@ -10,7 +10,6 @@ type=file
# EXPECTED
PARSE ERROR - fuzz_crash_013.md:1:1:1:2
PARSE ERROR - fuzz_crash_013.md:1:2:1:3
MISSING MAIN! FUNCTION - fuzz_crash_013.md:1:1:1:3
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -34,20 +33,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_013.md:1:1:1:3:**
```roc
0{
```
^^
# TOKENS
~~~zig
Int,OpenCurly,

View file

@ -14,7 +14,6 @@ PARSE ERROR - fuzz_crash_014.md:1:1:1:3
PARSE ERROR - fuzz_crash_014.md:1:3:1:5
PARSE ERROR - fuzz_crash_014.md:2:1:2:6
PARSE ERROR - fuzz_crash_014.md:3:1:3:5
MISSING MAIN! FUNCTION - fuzz_crash_014.md:1:1:3:5
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -60,21 +59,6 @@ This is an unexpected parsing error. Please check your syntax.
^^^^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_014.md:1:1:3:5:**
```roc
0b.0
0bu22
0u22
```
# TOKENS
~~~zig
MalformedNumberNoDigits,NoSpaceDotInt,

View file

@ -18,7 +18,6 @@ PARSE ERROR - fuzz_crash_015.md:2:1:2:4
PARSE ERROR - fuzz_crash_015.md:3:1:3:4
PARSE ERROR - fuzz_crash_015.md:3:4:3:6
PARSE ERROR - fuzz_crash_015.md:4:1:4:3
MISSING MAIN! FUNCTION - fuzz_crash_015.md:1:1:4:3
# PROBLEMS
**LEADING ZERO**
Numbers cannot have leading zeros.
@ -91,22 +90,6 @@ This is an unexpected parsing error. Please check your syntax.
^^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_015.md:1:1:4:3:**
```roc
0o0.0
0_0
0u8.0
0_
```
# TOKENS
~~~zig
Int,NoSpaceDotInt,

View file

@ -10,7 +10,6 @@ type=file
# EXPECTED
PARSE ERROR - fuzz_crash_016.md:1:1:1:2
PARSE ERROR - fuzz_crash_016.md:1:2:1:3
MISSING MAIN! FUNCTION - fuzz_crash_016.md:1:1:1:3
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -34,20 +33,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_016.md:1:1:1:3:**
```roc
0|
```
^^
# TOKENS
~~~zig
Int,OpBar,

View file

@ -11,7 +11,6 @@ foo = "hello ${namF
# EXPECTED
PARSE ERROR - fuzz_crash_017.md:2:7:2:8
UNRECOGNIZED SYNTAX - fuzz_crash_017.md:2:7:2:20
MISSING MAIN! FUNCTION - fuzz_crash_017.md:1:1:2:20
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `string_expected_close_interpolation`
@ -35,20 +34,6 @@ foo = "hello ${namF
This might be a syntax error, an unsupported language feature, or a typo.
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_017.md:1:1:2:20:**
```roc
me = "luc"
foo = "hello ${namF
```
# TOKENS
~~~zig
LowerIdent,OpAssign,StringStart,StringPart,StringEnd,

View file

@ -12,7 +12,6 @@ type=file
PARSE ERROR - fuzz_crash_018.md:1:1:1:2
PARSE ERROR - fuzz_crash_018.md:2:1:2:3
UNDECLARED TYPE - fuzz_crash_018.md:1:5:1:6
MISSING MAIN! FUNCTION - fuzz_crash_018.md:1:1:2:3
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -47,20 +46,6 @@ This type is referenced here:
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_018.md:1:1:2:3:**
```roc
0 b:S
.R
```
# TOKENS
~~~zig
Int,LowerIdent,OpColon,UpperIdent,

View file

@ -20,7 +20,6 @@ PARSE ERROR - fuzz_crash_021.md:1:16:1:16
PARSE ERROR - fuzz_crash_021.md:3:1:3:5
PARSE ERROR - fuzz_crash_021.md:4:1:4:1
MALFORMED TYPE - fuzz_crash_021.md:3:14:3:15
TYPE MODULE MISSING MATCHING TYPE - fuzz_crash_021.md:1:1:3:15
# PROBLEMS
**UNCLOSED STRING**
This string is missing a closing quote.
@ -142,23 +141,6 @@ Pair(a, b+ : (
^
**TYPE MODULE MISSING MATCHING TYPE**
Type modules must have a type declaration matching the module name.
This file is named `fuzz_crash_021`.roc, but no top-level type declaration named `fuzz_crash_021` was found.
Add either:
`fuzz_crash_021 := ...` (nominal type)
or:
`fuzz_crash_021 : ...` (type alias)
**fuzz_crash_021.md:1:1:3:15:**
```roc
Fli/main.roc" }
Pair(a, b+ : (
```
# TOKENS
~~~zig
UpperIdent,OpSlash,LowerIdent,NoSpaceDotLowerIdent,StringStart,StringPart,StringEnd,

View file

@ -229,7 +229,6 @@ INCOMPATIBLE MATCH PATTERNS - fuzz_crash_027.md:64:2:64:2
UNUSED VALUE - fuzz_crash_027.md:1:1:1:1
TYPE MISMATCH - fuzz_crash_027.md:111:2:113:3
UNUSED VALUE - fuzz_crash_027.md:111:2:113:3
TYPE MISMATCH - fuzz_crash_027.md:143:2:147:3
# PROBLEMS
**LEADING ZERO**
Numbers cannot have leading zeros.
@ -949,23 +948,6 @@ This expression produces a value, but it's not being used:
It has the type:
__d_
**TYPE MISMATCH**
This expression is used in an unexpected way:
**fuzz_crash_027.md:143:2:147:3:**
```roc
Stdoline!(
"How about ${ #
Num.toStr(number) # on expr
} as a",
)
```
It has the type:
_[Stdoline!(Error)][Err(_d), Ok({ })]_
But the type annotation says it should have the type:
_Try({ }, _d)_
# TOKENS
~~~zig
KwApp,OpenSquare,LowerIdent,CloseSquare,OpenCurly,LowerIdent,OpColon,KwPlatform,StringStart,StringPart,StringEnd,CloseCurly,

View file

@ -18,7 +18,6 @@ PARSE ERROR - fuzz_crash_031.md:1:7:1:8
PARSE ERROR - fuzz_crash_031.md:4:1:4:6
UNEXPECTED TOKEN IN EXPRESSION - fuzz_crash_031.md:4:10:4:11
UNRECOGNIZED SYNTAX - fuzz_crash_031.md:4:10:4:11
MISSING MAIN! FUNCTION - fuzz_crash_031.md:1:1:4:11
# PROBLEMS
**UNCLOSED SINGLE QUOTE**
This single-quoted literal is missing a closing quote.
@ -96,22 +95,6 @@ vavar t= '
This might be a syntax error, an unsupported language feature, or a typo.
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_031.md:1:1:4:11:**
```roc
mule []
#el
vavar t= '
```
# TOKENS
~~~zig
LowerIdent,OpenSquare,CloseSquare,

View file

@ -10,7 +10,6 @@ type=file
# EXPECTED
PARSE ERROR - fuzz_crash_038.md:1:1:1:2
PARSE ERROR - fuzz_crash_038.md:1:2:1:8
MISSING MAIN! FUNCTION - fuzz_crash_038.md:1:1:1:13
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -34,20 +33,6 @@ This is an unexpected parsing error. Please check your syntax.
^^^^^^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_038.md:1:1:1:13:**
```roc
*import B as
```
^^^^^^^^^^^^
# TOKENS
~~~zig
OpStar,KwImport,UpperIdent,KwAs,

View file

@ -8,22 +8,9 @@ type=file
~~~
# EXPECTED
MISSING MAIN! FUNCTION - fuzz_crash_064.md:2:1:2:1
NIL
# PROBLEMS
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_064.md:2:1:2:1:**
```roc
```
^
NIL
# TOKENS
~~~zig
EndOfFile,

View file

@ -9,22 +9,9 @@ type=file
b:r
~~~
# EXPECTED
MISSING MAIN! FUNCTION - fuzz_crash_079.md:2:1:2:4
NIL
# PROBLEMS
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_crash_079.md:2:1:2:4:**
```roc
b:r
```
^^^
NIL
# TOKENS
~~~zig
LowerIdent,OpColon,LowerIdent,

View file

@ -10,7 +10,6 @@ type=file
# EXPECTED
PARSE ERROR - fuzz_hang_001.md:1:1:1:2
PARSE ERROR - fuzz_hang_001.md:1:3:1:4
MISSING MAIN! FUNCTION - fuzz_hang_001.md:1:1:1:4
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -34,20 +33,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**fuzz_hang_001.md:1:1:1:4:**
```roc
0 (
```
^^^
# TOKENS
~~~zig
Int,OpenRound,

View file

@ -51,20 +51,6 @@ All branches in an `if` must have compatible types.
Note: You can wrap branches in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags>
**COMPTIME EVAL ERROR**
This definition could not be evaluated at compile time:
**if_then_else_simple_file.md:1:7:5:6:**
```roc
foo = if 1 A
else {
"hello"
}
```
The evaluation failed with error:
**TypeMismatch**
# TOKENS
~~~zig
LowerIdent,OpAssign,KwIf,Int,UpperIdent,

View file

@ -52,21 +52,6 @@ Is there an `import` or `exposing` missing up-top?
^^^^^^
**COMPTIME EVAL ERROR**
This definition could not be evaluated at compile time:
**import_exposing_basic.md:3:8:8:2:**
```roc
main = {
data = { name: "Alice", age: 30 }
encoded = encode(data)
decoded = decode(encoded)
decoded
}
```
The evaluation failed with error:
**TypeMismatch**
# TOKENS
~~~zig
KwImport,LowerIdent,NoSpaceDotUpperIdent,KwExposing,OpenSquare,LowerIdent,Comma,LowerIdent,CloseSquare,

View file

@ -84,25 +84,6 @@ But the third argument has the type:
`multi_arg_fn` needs these arguments to have compatible types.
**COMPTIME EVAL ERROR**
This definition could not be evaluated at compile time:
**lambda_multi_arg_mismatch.md:8:10:17:2:**
```roc
result = multi_arg_fn(
42, # x1: U64 (type 'a')
"hello", # x2: Str (type 'b') - correct
"world", # x3: Str (should be 'a' = U64) - MISMATCH
1.5, # x4: F64 (type 'c') - correct
3.14, # x5: F64 (should be 'a' = U64) - MISMATCH
[1, 2], # x6: List I64 (type 'd') - correct
True, # x7: Bool (should be 'a' = U64) - MISMATCH
"done", # x8: Str (type 'e') - correct
)
```
The evaluation failed with error:
**NotImplemented**
# TOKENS
~~~zig
LowerIdent,OpColon,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,OpArrow,OpenRound,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,CloseRound,

View file

@ -171,7 +171,7 @@ nested = { bar: A, count: 1 }
(inferred-types
(defs
(patt (type "List(Foo.Bar)"))
(patt (type "Try(Foo.Bar, Foo.Error)"))
(patt (type "Error"))
(patt (type "{ bar: Foo.Bar, count: Num(Int(Unsigned64)) }")))
(type_decls
(nominal (type "Foo")
@ -182,6 +182,6 @@ nested = { bar: A, count: 1 }
(ty-header (name "Foo.Error"))))
(expressions
(expr (type "List(Foo.Bar)"))
(expr (type "Try(Foo.Bar, Foo.Error)"))
(expr (type "Error"))
(expr (type "{ bar: Foo.Bar, count: Num(Int(Unsigned64)) }"))))
~~~

View file

@ -14,29 +14,9 @@ useBar : Foo.Bar
useBar = Something
~~~
# EXPECTED
TYPE MODULE MISSING MATCHING TYPE - nominal_associated_vs_module.md:1:1:7:19
NIL
# PROBLEMS
**TYPE MODULE MISSING MATCHING TYPE**
Type modules must have a type declaration matching the module name.
This file is named `nominal_associated_vs_module`.roc, but no top-level type declaration named `nominal_associated_vs_module` was found.
Add either:
`nominal_associated_vs_module := ...` (nominal type)
or:
`nominal_associated_vs_module : ...` (type alias)
**nominal_associated_vs_module.md:1:1:7:19:**
```roc
Foo := [Whatever].{
Bar := [Something]
}
# This should resolve to the local Foo.Bar, not try to import from a Foo module
useBar : Foo.Bar
useBar = Something
```
NIL
# TOKENS
~~~zig
UpperIdent,OpColonEqual,OpenSquare,UpperIdent,CloseSquare,Dot,OpenCurly,

View file

@ -96,7 +96,6 @@ TYPE DOES NOT HAVE METHODS - Color.md:37:21:37:45
TYPE DOES NOT HAVE METHODS - Color.md:38:21:38:45
TYPE DOES NOT HAVE METHODS - Color.md:39:21:39:45
TYPE DOES NOT HAVE METHODS - Color.md:40:21:40:45
TYPE MISMATCH - Color.md:32:5:45:6
TYPE DOES NOT HAVE METHODS - Color.md:62:8:62:28
# PROBLEMS
**MODULE HEADER DEPRECATED**
@ -314,32 +313,6 @@ This type doesn't support methods:
**TYPE MISMATCH**
This expression is used in an unexpected way:
**Color.md:32:5:45:6:**
```roc
match bytes {
['#', a, b, c, d, e, f] => {
is_valid =
a.is_char_in_hex_range()
and b.is_char_in_hex_range()
and c.is_char_in_hex_range()
and d.is_char_in_hex_range()
and e.is_char_in_hex_range()
and f.is_char_in_hex_range()
if is_valid Ok(Color.Hex(str)) else Err(InvalidHex("Expected Hex to be in the range 0-9, a-f, A-F, got ${str}"))
}
_ => Err(InvalidHex("Expected Hex must start with # and be 7 characters long, got ${str}"))
}
```
It has the type:
_[InvalidHex(Str), Err([InvalidHex(Str)]_others)][Ok(Color)]_others2_
But the type annotation says it should have the type:
_Try(Color, [InvalidHex(Str)])_
**TYPE DOES NOT HAVE METHODS**
You're calling the method `is_named_color` on a type that doesn't support methods:
**Color.md:62:8:62:28:**
@ -1305,7 +1278,7 @@ is_named_color = |str| {
(patt (type "Num(Int(Unsigned8)), Num(Int(Unsigned8)), Num(Int(Unsigned8)), Num(Int(Unsigned8)) -> Color"))
(patt (type "Str -> Error"))
(patt (type "Color -> Error"))
(patt (type "Str -> Try(Color, [UnknownColor(Str)])"))
(patt (type "Str -> Error"))
(patt (type "_arg -> Error")))
(type_decls
(nominal (type "Color")
@ -1315,6 +1288,6 @@ is_named_color = |str| {
(expr (type "Num(Int(Unsigned8)), Num(Int(Unsigned8)), Num(Int(Unsigned8)), Num(Int(Unsigned8)) -> Color"))
(expr (type "Str -> Error"))
(expr (type "Color -> Error"))
(expr (type "Str -> Try(Color, [UnknownColor(Str)])"))
(expr (type "Str -> Error"))
(expr (type "_arg -> Error"))))
~~~

View file

@ -21,17 +21,6 @@ Is there an `import` or `exposing` missing up-top?
^^^^^^
**COMPTIME CRASH**
This definition crashed during compile-time evaluation:
**statement_record_destructure.md:1:24:1:30:**
```roc
{ name, age, email } = person
```
^^^^^^
The `crash` happened with this message:
**Runtime error in expression**
# TOKENS
~~~zig
OpenCurly,LowerIdent,Comma,LowerIdent,Comma,LowerIdent,CloseCurly,OpAssign,LowerIdent,

View file

@ -16,7 +16,6 @@ PARSE ERROR - 002.md:1:1:1:3
PARSE ERROR - 002.md:1:4:1:6
PARSE ERROR - 002.md:1:7:1:8
PARSE ERROR - 002.md:1:8:1:9
MISSING MAIN! FUNCTION - 002.md:1:1:5:12
# PROBLEMS
**PARSE ERROR**
A parsing error occurred: `statement_unexpected_token`
@ -62,23 +61,6 @@ This is an unexpected parsing error. Please check your syntax.
^
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**002.md:1:1:5:12:**
```roc
@2 := {}
foo = "one"
bar = "two"
```
# TOKENS
~~~zig
OpaqueName,OpColonEqual,OpenCurly,CloseCurly,

View file

@ -33,8 +33,6 @@ UNDECLARED TYPE - type_app_complex_nested.md:4:27:4:32
UNDECLARED TYPE - type_app_complex_nested.md:4:48:4:53
UNUSED VARIABLE - type_app_complex_nested.md:7:12:7:21
UNDECLARED TYPE - type_app_complex_nested.md:12:14:12:19
TOO MANY ARGS - type_app_complex_nested.md:18:41:18:60
TOO MANY ARGS - type_app_complex_nested.md:4:38:4:58
# PROBLEMS
**UNDECLARED TYPE**
The type _Maybe_ is not declared in this scope.
@ -103,26 +101,6 @@ deepNested : Maybe(Try(List(Dict(Str, a)), _b)) -> a
^^^^^
**TOO MANY ARGS**
The type _Dict_ expects argument, but got instead.
**type_app_complex_nested.md:18:41:18:60:**
```roc
ComplexType(a, b) : Try(List(Maybe(a)), Dict(Str, Error(b)))
```
^^^^^^^^^^^^^^^^^^^
**TOO MANY ARGS**
The type _Dict_ expects argument, but got instead.
**type_app_complex_nested.md:4:38:4:58:**
```roc
processComplex : Try(List(Maybe(a)), Dict(Str, Error(_b))) -> List(a)
```
^^^^^^^^^^^^^^^^^^^^
# TOKENS
~~~zig
KwApp,OpenSquare,LowerIdent,CloseSquare,OpenCurly,LowerIdent,OpColon,KwPlatform,StringStart,StringPart,StringEnd,CloseCurly,
@ -351,7 +329,7 @@ main! = |_| processComplex(Ok([Some(42), None]))
~~~clojure
(inferred-types
(defs
(patt (type "Try(List(Error), Error) -> List(_c)"))
(patt (type "Error -> List(_c)"))
(patt (type "Error -> _ret"))
(patt (type "_arg -> List(_c)")))
(type_decls
@ -361,7 +339,7 @@ main! = |_| processComplex(Ok([Some(42), None]))
(ty-rigid-var (name "a"))
(ty-rigid-var (name "b"))))))
(expressions
(expr (type "Try(List(Error), Error) -> List(_c)"))
(expr (type "Error -> List(_c)"))
(expr (type "Error -> _ret"))
(expr (type "_arg -> List(_c)"))))
~~~

View file

@ -14,7 +14,6 @@ main! = |_| processDict(Dict.empty().insert("one", 1))
~~~
# EXPECTED
DOES NOT EXIST - type_app_multiple_args.md:6:25:6:35
TOO MANY ARGS - type_app_multiple_args.md:3:15:3:29
# PROBLEMS
**DOES NOT EXIST**
`Dict.empty` does not exist.
@ -26,16 +25,6 @@ main! = |_| processDict(Dict.empty().insert("one", 1))
^^^^^^^^^^
**TOO MANY ARGS**
The type _Dict_ expects argument, but got instead.
**type_app_multiple_args.md:3:15:3:29:**
```roc
processDict : Dict(Str, U64) -> List(Str)
```
^^^^^^^^^^^^^^
# TOKENS
~~~zig
KwApp,OpenSquare,LowerIdent,CloseSquare,OpenCurly,LowerIdent,OpColon,KwPlatform,StringStart,StringPart,StringEnd,CloseCurly,

View file

@ -127,9 +127,9 @@ main! = |_| processNested([])
~~~clojure
(inferred-types
(defs
(patt (type "List(Try(Str, Error)) -> List(Str)"))
(patt (type "List(Error) -> List(Str)"))
(patt (type "_arg -> List(Str)")))
(expressions
(expr (type "List(Try(Str, Error)) -> List(Str)"))
(expr (type "List(Error) -> List(Str)"))
(expr (type "_arg -> List(Str)"))))
~~~

View file

@ -107,6 +107,16 @@ BadType : SomeUndeclaredType
^^^^^^^^^^^^^^^^^^
**TOO MANY ARGS**
The type _Dict_ expects argument, but got instead.
**type_comprehensive_scope.md:29:10:29:24:**
```roc
MyDict : Dict(Str, U64)
```
^^^^^^^^^^^^^^
# TOKENS
~~~zig
UpperIdent,OpColon,UpperIdent,

View file

@ -8,24 +8,9 @@ type=file
SomeOtherName := [A, B]
~~~
# EXPECTED
TYPE MODULE MISSING MATCHING TYPE - WrongName.md:1:1:1:24
NIL
# PROBLEMS
**TYPE MODULE MISSING MATCHING TYPE**
Type modules must have a type declaration matching the module name.
This file is named `WrongName`.roc, but no top-level type declaration named `WrongName` was found.
Add either:
`WrongName := ...` (nominal type)
or:
`WrongName : ...` (type alias)
**WrongName.md:1:1:1:24:**
```roc
SomeOtherName := [A, B]
```
^^^^^^^^^^^^^^^^^^^^^^^
NIL
# TOKENS
~~~zig
UpperIdent,OpColonEqual,OpenSquare,UpperIdent,Comma,UpperIdent,CloseSquare,

View file

@ -8,22 +8,9 @@ type=file
x = 5
~~~
# EXPECTED
MISSING MAIN! FUNCTION - no_type_no_main.md:1:1:1:6
NIL
# PROBLEMS
**MISSING MAIN! FUNCTION**
Default app modules must have a `main!` function.
No `main!` function was found.
Add a main! function like:
`main! = |arg| { ... }`
**no_type_no_main.md:1:1:1:6:**
```roc
x = 5
```
^^^^^
NIL
# TOKENS
~~~zig
LowerIdent,OpAssign,Int,

View file

@ -254,12 +254,12 @@ main! = |_| {}
(inferred-types
(defs
(patt (type "[None, Some(Str)] -> Str"))
(patt (type "[Err2(_err)][Ok2(_ok)] -> Bool"))
(patt (type "[Err2(_err2)][Ok2(_ok2)] -> Bool"))
(patt (type "[Err2(_err)][Ok2(_ok)] -> Error"))
(patt (type "[Err2(_err2)][Ok2(_ok2)] -> Error"))
(patt (type "_arg -> {}")))
(expressions
(expr (type "[None, Some(Str)] -> Str"))
(expr (type "[Err2(_err)][Ok2(_ok)] -> Bool"))
(expr (type "[Err2(_err2)][Ok2(_ok2)] -> Bool"))
(expr (type "[Err2(_err)][Ok2(_ok)] -> Error"))
(expr (type "[Err2(_err2)][Ok2(_ok2)] -> Error"))
(expr (type "_arg -> {}"))))
~~~

View file

@ -243,7 +243,7 @@ NO CHANGE
~~~clojure
(inferred-types
(defs
(patt (type "Try(ok, err) -> Str"))
(patt (type "Error -> Str"))
(patt (type "Response -> Str"))
(patt (type "_arg -> {}")))
(type_decls
@ -258,7 +258,7 @@ NO CHANGE
(alias (type "ConnectionState")
(ty-header (name "ConnectionState"))))
(expressions
(expr (type "Try(ok, err) -> Str"))
(expr (type "Error -> Str"))
(expr (type "Response -> Str"))
(expr (type "_arg -> {}"))))
~~~

View file

@ -342,17 +342,17 @@ main = |_| "done"
~~~clojure
(inferred-types
(defs
(patt (type "Try(a, e), (a -> b) -> Try(b, e)"))
(patt (type "Error, (a -> b) -> Error"))
(patt (type "a -> a"))
(patt (type "a, b -> { first: a, second: b }"))
(patt (type "List(_a) -> Num(Int(Unsigned64))"))
(patt (type "a -> Try(Try(a, Str), Str)"))
(patt (type "a -> Error"))
(patt (type "_arg -> Str")))
(expressions
(expr (type "Try(a, e), (a -> b) -> Try(b, e)"))
(expr (type "Error, (a -> b) -> Error"))
(expr (type "a -> a"))
(expr (type "a, b -> { first: a, second: b }"))
(expr (type "List(_a) -> Num(Int(Unsigned64))"))
(expr (type "a -> Try(Try(a, Str), Str)"))
(expr (type "a -> Error"))
(expr (type "_arg -> Str"))))
~~~