fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8. }
  9. }
  10.  
  11. namespace A
  12. {
  13.  
  14. public abstract class BaseClass
  15. {
  16. protected virtual string GetData()
  17. {
  18. throw new NotImplementedException();
  19. }
  20. }
  21. }
  22.  
  23. namespace B //includes a reference to A
  24. {
  25. public abstract class BaseClass
  26. {
  27. }
  28.  
  29.  
  30. abstract class DerivedClassA : BaseClass
  31. {
  32.  
  33. }
  34.  
  35.  
  36. internal class DerivedClassB: DerivedClassA
  37. {
  38. public void write()
  39. {
  40. base.GetData(); // results in error.
  41.  
  42. // The name 'GetData' does not exist in the current context
  43. // and DerivedClassA does not contain a definition for 'GetData'
  44. }
  45. }
  46. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(40,19): error CS0117: `B.DerivedClassA' does not contain a definition for `GetData'
prog.cs(30,21): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty