Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 02c816fc4190a7dead3432560cc29586f44826a4)
+++ src/GenPoly/Box.cc	(revision f4abc582d3b6b606b643e66534b4f6671f8ecbdf)
@@ -1587,5 +1587,13 @@
 			assert( newMemberExpr );
 
-			Type *memberType = memberExpr->member->get_type();
+			// Must apply the generic substitution to the member type to handle cases where the member is a generic parameter substituted by a known concrete type, e.g.
+			//   forall(otype T) struct Box { T x; }
+			//   forall(otype T) f() {
+			//     Box(T *) b; b.x;
+			//   }
+			// TODO: memberExpr->result should be exactly memberExpr->member->get_type() after substitution, so it doesn't seem like it should be necessary to apply the substitution manually. For some reason this is not currently the case. This requires more investigation.
+			Type *memberType = memberExpr->member->get_type()->clone();
+			TypeSubstitution sub = objectType->genericSubstitution();
+			sub.apply( memberType );
 			if ( ! isPolyType( memberType, scopeTyVars ) ) {
 				// Not all members of a polymorphic type are themselves of polymorphic type; in this case the member expression should be wrapped and dereferenced to form an lvalue
@@ -1595,4 +1603,5 @@
 			}
 
+			delete memberType;
 			delete memberExpr;
 			return newMemberExpr;
