semantic/class-base-type-less-accessible.test \
semantic/class-compact-derived-instance-field.test \
semantic/class-compact-interface.test \
+ semantic/class-compact-method-baseaccess.test
+ semantic/class-compact-property-baseaccess.test
semantic/class-missing-implement-interface-method.test \
semantic/class-missing-implement-interface-property.test \
semantic/class-missing-implement-method.test \
--- /dev/null
+Invalid Code
+
+[Compact]
+public class Foo {
+ public virtual void bar () {
+ }
+}
+
+[Compact]
+public class Bar : Foo {
+ public override void bar () {
+ base ();
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+[Compact]
+public class Foo {
+ public int field = 23;
+ public virtual int prop {
+ get { return field; }
+ }
+}
+
+[Compact]
+public class Bar : Foo {
+ public override int prop {
+ get { return base.prop; }
+ }
+}
+
+void main () {
+}
error = true;
Report.error (source_reference, "Base access invalid without base class");
return false;
+ } else if (context.analyzer.current_class.is_compact && context.analyzer.current_method != null
+ && !(context.analyzer.current_method is CreationMethod)) {
+ error = true;
+ Report.error (source_reference, "Base access invalid in virtual overridden method of compact class");
+ return false;
+ } else if (context.analyzer.current_class.is_compact && context.analyzer.current_property_accessor != null) {
+ error = true;
+ Report.error (source_reference, "Base access invalid in virtual overridden property of compact class");
+ return false;
} else {
foreach (var base_type in context.analyzer.current_class.get_base_types ()) {
if (base_type.data_type is Class) {