Skip to content

Commit

Permalink
Fix missing argument IL value
Browse files Browse the repository at this point in the history
  • Loading branch information
degory committed Apr 15, 2024
1 parent 487177b commit 9cd40d0
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.8.42-alpha.124</Version>
<Version>0.8.42-alpha.125</Version>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run test",
"command": "dotnet ghul-test \"${workspaceFolder}\"",
"type": "shell",
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Capture test expectation",
"command": "../../../tasks/capture.sh \"${workspaceFolder}\"",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"compiler": "dotnet ../../../publish/ghul.dll"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--dotnet
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
construct THING(123,'hello',False)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use IO.Std.write_line;

class Main is
entry() static is
let t1 =
THING(
if true then 123 else 456 fi,
if false then "goodbye" else "hello" fi,
if true then false else true fi
);
si
si

class THING is
init(a: int, b: string, c: bool) is
write_line("construct THING({a},'{b}',{c})");
si
si
Empty file.
6 changes: 4 additions & 2 deletions src/syntax/process/compile_expressions.ghul
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,6 @@ namespace Syntax.Process is
if implied_argument_type? /\ !implied_argument_type.is_type_variable then
argument_types.add(implied_argument_type);

a.try_set_constraint(implied_argument_type, "{{0}} is not compatible with {{1}}");

symbol.set_type(implied_argument_type);
else
_logger.error(a.location, "cannot infer type here");
Expand Down Expand Up @@ -1353,6 +1351,8 @@ namespace Syntax.Process is
// ensure any error messages are committed
a.walk(self);
fi

arguments[index] = a.value;
od

overload_result = _overload_resolver.resolve(location, function_group, argument_types, false, true, true);
Expand Down Expand Up @@ -2649,6 +2649,8 @@ namespace Syntax.Process is
// ensure any error messages are committed
a.walk(self);
fi

arguments[index] = a.value;
od

overload_result = _overload_resolver.resolve(call.arguments.location, function_group, argument_types, false, want_instance, false);
Expand Down

0 comments on commit 9cd40d0

Please sign in to comment.