fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. int X {get;set;}
  6. static void Foo(out int x) {
  7. x = 123;
  8. }
  9. public static void Main()
  10. {
  11. var t = new Test();
  12. Foo(out t.X);
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(12,27): error CS0206: A property, indexer or dynamic member access may not be passed as `ref' or `out' parameter
prog.cs(12,17): error CS1502: The best overloaded method match for `Test.Foo(out int)' has some invalid arguments
prog.cs(6,21): (Location of the symbol related to previous error)
prog.cs(12,17): error CS1503: Argument `#1' cannot convert `object' expression to type `int'
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty