Opened 4 years ago

Last modified 4 years ago

#176 new defect

Assignment fails for union structure field

Reported by: pabuhr Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:

Description (last modified by pabuhr)

forall( dtype T )
union Link {
	struct {
		T * top;
		uintptr_t count;
	__int128 atom; // both fields

int fred() {
	Link(int) l;
	int i = l.count, * ip =;
	__int128 I = l.atom;
	i = l.count;
	ip =;
	I = l.atom;
CFA Version 1.0.0 (debug) error: No reasonable alternatives for expression Applying untyped:
  Name: ?=?
  Name: ip
  Untyped Member Expression, with field: 
    Name: top  ... from aggregate:
    Name: l

The assignment fails because top is of type T. Assignment to non-polymorphic types works.

Change History (1)

comment:1 Changed 4 years ago by pabuhr

Description: modified (diff)
Note: See TracTickets for help on using tickets.