Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing instance of a function results in crash during air phase #3324

Open
fridis opened this issue Jul 7, 2024 · 0 comments
Open

Accessing instance of a function results in crash during air phase #3324

fridis opened this issue Jul 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules

Comments

@fridis
Copy link
Member

fridis commented Jul 7, 2024

This example passes the instance of a function b as a boxed value to a routine expecting an argument of type Any

u(x Any) => _ := $x
b => u b.this
b

but this results in a crash:

 > ./build/bin/fz test_func.fz

error 1: Found error clazz in set of clazzes in the IR even though no earlier errors were reported.  This can only be the result of a severe bug.

one error.

or precondition failure:

 > PRECONDITIONS=true POSTCONDITIONS=true ./build/bin/fz test_func.fz

error 1: java.lang.Error: require-condition1 failed: AbstractFeature.java:1049 "(isTypeFeature() || hasTypeFeature());"
	at dev.flang.util.ANY.require(ANY.java:100)
	at dev.flang.ast.AbstractFeature.typeFeature(AbstractFeature.java:1049)
	at dev.flang.ast.AbstractType.typeType(AbstractType.java:1546)
	at dev.flang.ast.AbstractType.typeType(AbstractType.java:1513)
	at dev.flang.air.Clazz.typeClazz(Clazz.java:2166)
	at dev.flang.air.Clazz.determineResultClazz(Clazz.java:2278)
	at dev.flang.air.Clazz.dependencies(Clazz.java:486)
	at dev.flang.air.Clazzes.create(Clazzes.java:356)
	at dev.flang.air.Clazzes.clazzWithSpecificOuter(Clazzes.java:1071)
	at dev.flang.air.Clazz.lookup(Clazz.java:1337)

@fridis fridis added bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules labels Jul 7, 2024
@fridis fridis self-assigned this Jul 7, 2024
fridis added a commit that referenced this issue Jul 7, 2024
Also duplicated the tests in `reg_issue3308` to be executed within a function
`b` additionally to the constructor `a`.  This includes the case from #3324,
which is currently commented out in the test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules
Projects
None yet
Development

No branches or pull requests

1 participant