fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Small example with main feature that has type parameter results in precondition failuer or null pointer

Open fridis opened this issue 1 year ago • 0 comments

See this

 > PRECONDITIONS=true POSTCONDITIONS=true ./build/bin/fz -e "x(v T) => _ := T"

command line:1:1: error 1: Main feature must not have arguments
x(v T) => _ := T

Main feature has one argument ('x.v'), but should have no arguments to be used as main feature in an application
To solve this, remove the arguments from feature 'x'


command line:1:1: error 2: Main feature must not have type arguments
x(v T) => _ := T

Main feature has one type argument T, but should have no arguments to be used as main feature in an application
To solve this, remove the arguments from feature 'x'


error 3: java.lang.Error: require-condition1 failed: AbstractType.java:1500 "(!isGenericArgument(), feature().state().atLeast(State.RESOLVED));"
	at dev.flang.util.ANY.require(ANY.java:115)
	at dev.flang.ast.AbstractType.typeType(AbstractType.java:1500)
	at dev.flang.air.Clazz.typeClazz(Clazz.java:2138)
	at dev.flang.air.Clazz.determineResultClazz(Clazz.java:2244)
	at dev.flang.air.Clazz.dependencies(Clazz.java:472)
...

Disabling pre/posconditions results in a NullPointerException.

fridis avatar Aug 07 '24 08:08 fridis