Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/Concurrency/Keywords.cc	(revision 1def18bbb819e16e167e9992eb88901d5d8ec5f4)
@@ -59,4 +59,5 @@
 
 		Declaration * postmutate( StructDecl * decl );
+		DeclarationWithType * postmutate( FunctionDecl * decl );
 
 		void handle( StructDecl * );
@@ -77,5 +78,6 @@
 		KeywordCastExpr::Target cast_target;
 
-		StructDecl* type_decl = nullptr;
+		StructDecl   * type_decl = nullptr;
+		FunctionDecl * dtor_decl = nullptr;
 	};
 
@@ -97,5 +99,5 @@
 			"__thrd",
 			"get_thread",
-			"thread keyword requires threads to be in scope, add #include <thread.hfa>",
+			"thread keyword requires threads to be in scope, add #include <thread.hfa>\n",
 			true,
 			KeywordCastExpr::Thread
@@ -129,5 +131,5 @@
 			"__cor",
 			"get_coroutine",
-			"coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa>",
+			"coroutine keyword requires coroutines to be in scope, add #include <coroutine.hfa>\n",
 			true,
 			KeywordCastExpr::Coroutine
@@ -161,5 +163,5 @@
 			"__mon",
 			"get_monitor",
-			"monitor keyword requires monitors to be in scope, add #include <monitor.hfa>",
+			"monitor keyword requires monitors to be in scope, add #include <monitor.hfa>\n",
 			false,
 			KeywordCastExpr::Monitor
@@ -284,8 +286,27 @@
 	}
 
+	DeclarationWithType * ConcurrentSueKeyword::postmutate( FunctionDecl * decl ) {
+		if( !type_decl ) return decl;
+		if( !CodeGen::isDestructor( decl->name ) ) return decl;
+
+		auto params = decl->type->parameters;
+		if( params.size() != 1 ) return decl;
+
+		auto type = dynamic_cast<ReferenceType*>( params.front()->get_type() );
+		if( !type ) return decl;
+
+		auto stype = dynamic_cast<StructInstType*>( type->base );
+		if( !stype ) return decl;
+		if( stype->baseStruct != type_decl ) return decl;
+
+		if( !dtor_decl ) dtor_decl = decl;
+		return decl;
+	}
+
 	Expression * ConcurrentSueKeyword::postmutate( KeywordCastExpr * cast ) {
 		if ( cast_target == cast->target ) {
 			// convert (thread &)t to (thread_desc &)*get_thread(t), etc.
 			if( !type_decl ) SemanticError( cast, context_error );
+			if( !dtor_decl ) SemanticError( cast, context_error );
 			Expression * arg = cast->arg;
 			cast->arg = nullptr;
@@ -308,4 +329,5 @@
 
 		if( !type_decl ) SemanticError( decl, context_error );
+		if( !dtor_decl ) SemanticError( decl, context_error );
 
 		FunctionDecl * func = forwardDeclare( decl );
