Skip to content

Commit

Permalink
check type during equality for or-types only
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev committed Dec 9, 2023
1 parent 1dcf480 commit 14a6f03
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ftd/src/interpreter/things/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ impl Expression {
let infer_from_value = result.get(&infer_from.value).unwrap();

match v {
ftd::interpreter::StateWithThing::Thing(thing) => {
ftd::interpreter::StateWithThing::Thing(thing)
if infer_from_value.kind().inner().is_or_type() =>
{
if thing.kind().inner().eq(&infer_from_value.kind().inner()) {
ftd::interpreter::StateWithThing::new_thing(thing)
} else {
Expand Down
2 changes: 1 addition & 1 deletion ftd/t/js/31-advance-list.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $on-input$: $ftd.set-integer($a = $form.ns.score, v = $VALUE)
-- end: ftd.column

-- ftd.text: Submit
if: { !ftd.is_empty(form.ns.name) && !ftd.is_empty(form.ns.score) }
if: { form.ns.name != ftd.empty && form.ns.score != ftd.empty }
$on-click$: $insert($a = $name-scores, v = *$form.ns)
background.solid: #4CAF50
color: white
Expand Down
5 changes: 3 additions & 2 deletions ftd/t/js/31-advance-list.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 14a6f03

Please sign in to comment.