fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

confusing error messages when using ⋂ as name of feature

Open miclill opened this issue 4 years ago • 3 comments

this works

ex218 is
  intersection (a psSet<string>, b psSet<string>) =>
    (a ⋃ b).filter(fun (x string) => a.has x && b.has x)
    
  setOne := psSet<string>.addAll(["eins", "zwei", "drei"])
  setTwo := psSet<string>.addAll(["drei", "vier", "fünf"])
  
  say (intersection(setOne, setTwo))

when replacing 'intersection' by ⋂ fuzion gives 13 error messages. 'Inconsistent indentation' being the first. (Indention was not changed by replacement.)

ex218 is
  ⋂ (a psSet<string>, b psSet<string>) =>
    (a ⋃ b).filter(fun (x string) => a.has x && b.has x)
    
  setOne := psSet<string>.addAll(["eins", "zwei", "drei"])
  setTwo := psSet<string>.addAll(["drei", "vier", "fünf"])
  
  say (⋂(setOne, setTwo))

miclill avatar Jul 22 '21 13:07 miclill

now, only two error messages, but they still miss the point

ex218 is
  ⋂ (a ref psSet string, b ref psSet string) =>
    (a ⋃ b).filter(x -> a.has x && b.has x)

  setOne := (psSets string).empty.addAll(["eins", "zwei", "drei"])
  setTwo := (psSets string).empty.addAll(["drei", "vier", "fünf"])

  say (⋂(setOne, setTwo))

michaellilltokiwa avatar Oct 21 '22 08:10 michaellilltokiwa

updated:

ex218 is
  ⋂ (a psSet string, b psSet string) =>
    (a ⋃ b).filter(x -> a.has x && b.has x)

michaellilltokiwa avatar May 28 '24 07:05 michaellilltokiwa

updated

ex218 is
  ⋂ (a (container.ps_set String), b (container.ps_set String)) =>
    (a ∪ b).filter(x -> a.has x && b.has x)
❯ FUZION_DISABLE_ANSI_ESCAPES=true fz /tmp/issue34.fz  

/tmp/issue34.fz:2:5: error 1: Failed to infer open type parameter type from actual argument.
  ⋂ (a (container.ps_set String), b (container.ps_set String)) =>
----^
Type of second actual argument could not be inferred at /tmp/issue34.fz:2:6:
  ⋂ (a (container.ps_set String), b (container.ps_set String)) =>
-----^

one error.

simonvonhackewitz avatar Mar 12 '25 13:03 simonvonhackewitz

I think this does not happen often and error message is fine now, closing

michaellilltokiwa avatar Apr 29 '25 07:04 michaellilltokiwa