Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 4789f44f209a3abbeda0761c6adc954c88a1bff8)
+++ src/GenPoly/Box.cc	(revision 658f6de0ed93906e66453f048c3c4bfd269e58ce)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Fri Feb 05 12:23:10 2016
-// Update Count     : 280
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Feb  5 16:45:07 2016
+// Update Count     : 286
 //
 
@@ -549,5 +549,8 @@
 					arg = new AddressExpr( arg );
 				} else {
-					ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, arg->get_results().front()->clone(), 0 );
+					// use type computed in unification to declare boxed variables
+					Type * newType = param->clone();
+					if ( env ) env->apply( newType );
+					ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, newType, 0 );
 					newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
 					stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
