Custom Query (146 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (4 - 6 of 146)

1 2 3 4 5 6 7 8 9 10 11 12
Ticket Owner Reporter Resolution Summary
#43 Rob Schluntz <rschlunt@…> Thierry Delisle 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 pabuhr Rob Schluntz 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 pabuhr 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:

Name: sum

...to:

constant expression (3: signed int) Name: a

1 2 3 4 5 6 7 8 9 10 11 12
Note: See TracQuery for help on using queries.