Custom Query (146 matches)
Results (4 - 6 of 146)
Ticket | Owner | Reporter | Resolution | Summary |
---|---|---|---|---|
#43 | fixed | Anonymous generics ctor | ||
Description |
The following data structure cannot be constructed : typedef void (*fptr_t)(); forall( dtype T ) struct __array { T * data; short size; }; struct guard_t { struct { __array( float ); fptr_t func; } prev; }; void ?{}( guard_t & this, float * ptr, short size, fptr_t func ) { // Save previous thread context (this.prev).data = ptr; this.prev.size = size; this.prev.func = func; } |
|||
#1 | fixed | Self-referential generic types require forward declarations | ||
Description |
The parser does not recognize generic types until the ending semicolon. forall(otype T) struct List { List(int) * x; // parsing error }; The current workaround is to forward declare generic types. forall(otype T) struct List; forall(otype T) struct List { List(int) * x; // okay, forward declaration makes List a generic type }; |
|||
#8 | fixed | No reasonable alternative | ||
Description |
forall( otype T | { void ?{}( T &, zero_t ); T ?+?( T, T ); } ) T sum( int n, T a[] ) { T total = 0; // instantiate T, select 0 for ( int i = 0; i < n; i += 1 ) total = total + a[i]; // select + return total; } int mmain() { int a[3]; int i; i = sum( 3, a ); } cfa test10.c CFA Version 1.0.0 (debug) test10.c:12 error: No reasonable alternatives for expression Applying untyped:
...to:
|
Note: See TracQuery
for help on using queries.