You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
out :=
for res := [], res ++ new_res
i := 0, i+1
while i<10
do
new_res := [i]
say out
And the error is
/home/simon/playground/java_exception_test.fz:2:7: error 1: Illegal forward or cyclic type inference
for res := [], res ++ new_res
------^^^
The definition of a field using ':=', or of a feature or function
using '=>' must not create cyclic type dependencies.
Referenced feature: 'res' at /home/simon/playground/java_exception_test.fz:2:7:
for res := [], res ++ new_res
------^^^
error 2: java.lang.StackOverflowError
at dev.flang.ast.Assign.<init>(Assign.java:117)
at dev.flang.ast.Feature$9.<init>(Feature.java:2047)
at dev.flang.ast.Feature.resolveTypes(Feature.java:2046)
at dev.flang.ast.Feature$ResolveTypes.action(Feature.java:1379)
at dev.flang.ast.Feature.visit(Feature.java:2013)
at dev.flang.ast.Impl.inferredType(Impl.java:616)
at dev.flang.ast.Feature.resultTypeIfPresent(Feature.java:2349)
at dev.flang.ast.AbstractAssign.resultTypeKnown(AbstractAssign.java:245)
...
The text was updated successfully, but these errors were encountered:
fridis
added
bug
Something isn't working
front end
related to the front end until .fum file is created: call and type resolution, type checking, etc.
labels
Jul 9, 2024
This is the faulty code
And the error is
The text was updated successfully, but these errors were encountered: