Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision 362f760a284baf8550e6a489049aa3a244d68a41)
+++ src/Concurrency/Keywords.cc	(revision a494d1055b2782f956b9b766d4b211dbc716fc5a)
@@ -422,6 +422,7 @@
 			;
 		else if ( auto param = isMainFor( decl, cast_target ) ) {
-			// This should never trigger.
-			assert( vtable_decl );
+			if ( !vtable_decl ) {
+				SemanticError( decl, context_error );
+			}
 			// Should be safe because of isMainFor.
 			StructInstType * struct_type = static_cast<StructInstType *>(
Index: tests/concurrent/.expect/mainError.txt
===================================================================
--- tests/concurrent/.expect/mainError.txt	(revision a494d1055b2782f956b9b766d4b211dbc716fc5a)
+++ tests/concurrent/.expect/mainError.txt	(revision a494d1055b2782f956b9b766d4b211dbc716fc5a)
@@ -0,0 +1,11 @@
+concurrent/mainError.cfa:1:1 error: thread keyword requires threads to be in scope, add #include <thread.hfa>
+thread Test: with body 1
+
+concurrent/mainError.cfa:2:1 error: thread keyword requires threads to be in scope, add #include <thread.hfa>
+main: function
+... with parameters
+  reference to instance of struct Test with body 1
+... returning nothing
+... with body
+  CompoundStmt
+
Index: tests/concurrent/mainError.cfa
===================================================================
--- tests/concurrent/mainError.cfa	(revision a494d1055b2782f956b9b766d4b211dbc716fc5a)
+++ tests/concurrent/mainError.cfa	(revision a494d1055b2782f956b9b766d4b211dbc716fc5a)
@@ -0,0 +1,2 @@
+thread Test {};
+void main(Test&) {}
