fuzion
fuzion copied to clipboard
confusing error messages when using ⋂ as name of feature
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))
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))
updated:
ex218 is
⋂ (a psSet string, b psSet string) =>
(a ⋃ b).filter(x -> a.has x && b.has x)
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.
I think this does not happen often and error message is fine now, closing