fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

type constraints using `Type.infix :` do not work if they are used in boolean expressions

Open fridis opened this issue 1 year ago • 0 comments

This is an open task related to #3480: More complex boolean expressions like pre T : x && U : y or if !(T : x) || cc then ... else ...T is x here.. do not work yet as expected. Here is a small example

test(T, U type, t T, u U) is
  constraint(Q type)
    pre
      true && (T : String)
  =>
    say t.codepoint_length
    if !(U : Sequence Q)
    else
      say u.count

test "㋡" [1,2,3]
  .constraint i32

that currently produces errors that it should not produce

 > ./build/bin/fz test_constraint1.fz

/home/fridi/fuzion/work/test_constraint1.fz:6:11: error 1: Could not find called feature
    say t.codepoint_length

Feature not found: 'codepoint_length' (no arguments)
Target feature: 'Any'
In call: 't.codepoint_length'


/home/fridi/fuzion/work/test_constraint1.fz:9:13: error 2: Could not find called feature
      say u.count

Feature not found: 'count' (no arguments)
Target feature: 'Any'
In call: 'u.count'

2 errors.

fridis avatar Aug 15 '24 10:08 fridis