mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
Fix playground
This commit is contained in:
parent
22fc0eca3f
commit
7c03cc516a
8 changed files with 12 additions and 43 deletions
|
|
@ -942,48 +942,11 @@ fn compileSource(source: []const u8) !CompilerStageData {
|
|||
const base_ptr = @intFromPtr(buffer.ptr);
|
||||
|
||||
logDebug("loadCompiledModule: About to deserialize common\n", .{});
|
||||
const deserialized_common = serialized_ptr.common.deserialize(@as(i64, @intCast(base_ptr)), module_source).*;
|
||||
logDebug("loadCompiledModule: common deserialized successfully\n", .{});
|
||||
|
||||
logDebug("loadCompiledModule: About to deserialize types\n", .{});
|
||||
const deserialized_types = serialized_ptr.types.deserialize(@as(i64, @intCast(base_ptr)), gpa).*;
|
||||
logDebug("loadCompiledModule: types deserialized successfully\n", .{});
|
||||
|
||||
logDebug("loadCompiledModule: About to deserialize external_decls\n", .{});
|
||||
const deserialized_external_decls = serialized_ptr.external_decls.deserialize(@as(i64, @intCast(base_ptr))).*;
|
||||
logDebug("loadCompiledModule: external_decls deserialized successfully\n", .{});
|
||||
|
||||
logDebug("loadCompiledModule: About to deserialize imports\n", .{});
|
||||
const deserialized_imports = serialized_ptr.imports.deserialize(@as(i64, @intCast(base_ptr)), gpa).*;
|
||||
logDebug("loadCompiledModule: imports deserialized successfully\n", .{});
|
||||
|
||||
logDebug("loadCompiledModule: About to deserialize store\n", .{});
|
||||
const deserialized_store_ptr = serialized_ptr.store.deserialize(@as(i64, @intCast(base_ptr)), gpa);
|
||||
const deserialized_store = deserialized_store_ptr.*;
|
||||
logDebug("loadCompiledModule: store deserialized successfully\n", .{});
|
||||
|
||||
// Intern the module name for fast comparisons
|
||||
const module_name_idx = module_env_ptr.common.idents.insert(gpa, base.Ident.for_text(module_name_param)) catch unreachable;
|
||||
|
||||
logDebug("loadCompiledModule: All deserialized, constructing ModuleEnv\n", .{});
|
||||
module_env_ptr.* = ModuleEnv{
|
||||
.gpa = gpa,
|
||||
.common = deserialized_common,
|
||||
.types = deserialized_types,
|
||||
.module_kind = serialized_ptr.module_kind,
|
||||
.all_defs = serialized_ptr.all_defs,
|
||||
.all_statements = serialized_ptr.all_statements,
|
||||
.exports = serialized_ptr.exports,
|
||||
.builtin_statements = serialized_ptr.builtin_statements,
|
||||
.external_decls = deserialized_external_decls,
|
||||
.imports = deserialized_imports,
|
||||
.module_name = module_name_param,
|
||||
.module_name_idx = module_name_idx,
|
||||
.diagnostics = serialized_ptr.diagnostics,
|
||||
.store = deserialized_store,
|
||||
.evaluation_order = null,
|
||||
};
|
||||
logDebug("loadCompiledModule: ModuleEnv constructed successfully\n", .{});
|
||||
// Use the built-in deserialize method instead of manually deserializing each field
|
||||
// This ensures proper offset calculations when the struct layout changes
|
||||
logDebug("loadCompiledModule: About to deserialize ModuleEnv\n", .{});
|
||||
module_env_ptr.* = serialized_ptr.deserialize(@as(i64, @intCast(base_ptr)), gpa, module_source, module_name_param).*;
|
||||
logDebug("loadCompiledModule: ModuleEnv deserialized successfully\n", .{});
|
||||
|
||||
logDebug("loadCompiledModule: Returning LoadedModule\n", .{});
|
||||
return .{ .env = module_env_ptr, .buffer = buffer, .gpa = gpa };
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const expected_safelist_u8_size = 24;
|
|||
const expected_safelist_u32_size = 24;
|
||||
const expected_safemultilist_teststruct_size = 24;
|
||||
const expected_safemultilist_node_size = 24;
|
||||
const expected_moduleenv_size = 604; // Platform-independent size
|
||||
const expected_moduleenv_size = 608; // Platform-independent size
|
||||
const expected_nodestore_size = 96; // Platform-independent size
|
||||
|
||||
// Compile-time assertions - build will fail if sizes don't match expected values
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ TOO FEW ARGS - fuzz_crash_027.md:21:3:22:4
|
|||
INVALID IF CONDITION - fuzz_crash_027.md:50:5:50:5
|
||||
INCOMPATIBLE MATCH PATTERNS - fuzz_crash_027.md:64:2:64:2
|
||||
TYPE MISMATCH - 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.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -81,6 +81,7 @@ is_named_color = |str|{
|
|||
MODULE HEADER DEPRECATED - Color.md:1:1:8:2
|
||||
UNUSED VARIABLE - Color.md:30:5:30:25
|
||||
DOES NOT EXIST - Color.md:68:14:68:27
|
||||
TYPE MISMATCH - Color.md:32:5:45:6
|
||||
TYPE MISMATCH - Color.md:51:104:51:105
|
||||
# PROBLEMS
|
||||
**MODULE HEADER DEPRECATED**
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ UNDECLARED TYPE - type_app_complex_nested.md:4:30:4:35
|
|||
UNDECLARED TYPE - type_app_complex_nested.md:4:51:4:56
|
||||
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:44:18:63
|
||||
TOO MANY ARGS - type_app_complex_nested.md:4:41:4:61
|
||||
# PROBLEMS
|
||||
**UNDECLARED TYPE**
|
||||
The type _Maybe_ is not declared in this scope.
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ 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.
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ TYPE REDECLARED - type_comprehensive_scope.md:10:1:10:37
|
|||
UNDECLARED TYPE - type_comprehensive_scope.md:13:19:13:23
|
||||
TYPE REDECLARED - type_comprehensive_scope.md:22:1:22:13
|
||||
UNDECLARED TYPE - type_comprehensive_scope.md:25:11:25:29
|
||||
TOO MANY ARGS - type_comprehensive_scope.md:29:10:29:24
|
||||
# PROBLEMS
|
||||
**TYPE REDECLARED**
|
||||
The type _Result_ is being redeclared.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue