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
When using generics and writing a little complex structure like follow the compilation is terminated as the generated Hash name for component mismatches
target C;
// Hash issue
// Header name mismatch
reactor bundle <In, Out> {
input in:In;
output out:Out;
}
reactor Parent<In, Out> extends bundle {
input in2:In;
output out2:Out;
reaction(in, in2) -> out, out2 {=
if (in->is_present)
lf_set(out, in->value * 3.1415);
else
lf_set(out2, in2->value * 3.1415);
=}
}
reactor Child<T1, In, Out> extends Parent {
reaction(in, in2) {=
int a = in->is_present ? in->value : in2->value;
printf("Got %d\n", a);
=}
}
reactor Super<T1, T2, T3, In, Out> extends bundle {
state t1:T1;
c = new Child<T3, In, Out>();
in -> c.in;
c.out -> out;
}
main reactor {
cc = new Super<long, double, char, int, float>();
}
this produces the following output
In file included from /Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/super53186033.c:4:
/Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/./super53186033.h:4:10: fatal error: 'child662411343.h' file not found
#include "child662411343.h"In file included from /Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/test586877047_main.c:4:
In file included from /Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/./test586877047_main.h:4:
/Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/./super53186033.h:4:10 ^~~~~~~~~~~~~~~~~~:
fatal error: 'child662411343.h' file not found
#include "child662411343.h"
^~~~~~~~~~~~~~~~~~
11 error generated.
error generated.
make[2]: *** [CMakeFiles/test.dir/test586877047_main.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/test.dir/super53186033.c.o] Error 1
In file included from /Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/test.c:19:
/Users/khubaibumer/git/LF_Collaboration/CGenericsProposal/src-gen/test/./super53186033.h:4:10: fatal error: 'child662411343.h' file not found
#include "child662411343.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/test.dir/test.c.o] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2
The text was updated successfully, but these errors were encountered:
This hashcode-based mechanism (which I am responsible for) needs to be replaced with something that is less ad hoc. In addition to having this bug, it also causes generated files to accumulate in src-gen instead of replacing old files, and it results in file names that are unnecessarily long and hard to read.
This is closely related to the second point in #1765; in order to fully close this issue it will be necessary to address that part of #1765. It might take perhaps a week to do this.
When using generics and writing a little complex structure like follow the compilation is terminated as the generated Hash name for component mismatches
this produces the following output
The text was updated successfully, but these errors were encountered: