Opened 9 years ago
Closed 6 years ago
#8 closed defect (fixed)
No reasonable alternative
| Reported by: | pabuhr | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | Resolver |
| Cc: |
Description (last modified by )
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
Change History (5)
comment:1 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 years ago
comment:4 by , 6 years ago
| Keywords: | Resolver added |
|---|
comment:5 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
This appears to be related to #3 and #4, as adding these fixes it:
void ?{}( int *, zero_t ); // need zero_t to int constructor void ?{}( int * ); // previous constructor hides default