fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

`StackOverflowError` after syntax error for single-line feature with post-condition.

Open fridis opened this issue 1 year ago • 0 comments

this happens:

 > ./build/bin/fz -e "f i32 post true => 42"

command line:2:1: error 1: Syntax error: expected 'is', ':=' or '{', found end-of-file

^
While parsing: impl, parse stack: implFldOrRout, routOrField, feature, expr, exprs, block, unit


error 2: java.lang.StackOverflowError
	at dev.flang.ast.Expr.typeForInferencing(Expr.java:201)
	at dev.flang.ast.Expr.type(Expr.java:167)
	at dev.flang.ast.Expr.typeForInferencing(Expr.java:201)
	at dev.flang.ast.Expr.type(Expr.java:167)
	at dev.flang.ast.Expr.typeForInferencing(Expr.java:201)
	at dev.flang.ast.Expr.type(Expr.java:167)
	at dev.flang.ast.Expr.typeForInferencing(Expr.java:201)

And there are two problems: first, this should not crash with a StackOverflowError. Then, there should be some valid syntax to declare a single-line feature with a post condition.

fridis avatar May 13 '24 12:05 fridis