diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 04cecfd..68d9637 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -47,6 +47,12 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 				// Enum.VALUE.to_string()
 				var en = (Enum) ma.inner.value_type.data_type;
 				ccall.call = new CCodeIdentifier (generate_enum_tostring_function (en));
+			} else if (m.is_virtual && ma.inner != null && ma.inner.value_type is ObjectType) {
+				var inner_type = ((ObjectType) ma.inner.value_type).type_symbol;
+				if (inner_type is Class && ((Class) inner_type).is_compact) {
+					/* Allow access to virtual methods in compact classes by assuming they are function pointers stored in the structure */
+					ccall = new CCodeFunctionCall(new CCodeMemberAccess(get_cvalue (ma.inner), get_ccode_name(m), true));
+				}
 			}
 		} else if (itype is SignalType) {
 			var sig_type = (SignalType) itype;
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index c2de41d..58aaef0 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -586,7 +586,7 @@ public class Vala.Method : Subroutine {
 
 			if (parent_symbol is Class) {
 				var cl = (Class) parent_symbol;
-				if (cl.is_compact) {
+				if (cl.is_compact && !external_package) {
 					Report.error (source_reference, "Virtual methods may not be declared in compact classes");
 					return false;
 				}
