Merge pull request #4926 from BrzVlad/fix-tls-v5
[mono-project.git] / mcs / errors / cs0027-2.cs
blob55326b1eaecd8275169f334006da96524b5b6e8a
1 // CS0027: Keyword `this' is not available in the current context
2 // Line: 10
4 // Attention: Here the compiler complains saying that cannot convert implicitly from 'Error0027' to 'int' but
5 // should also say that the use of keyword 'this' is out of context since it's used outside a constructor, method
6 // or property.
7 using System;
9 class Error0027 {
10 int i = this;
11 int x = 0;
13 public static void Main () {
14 Console.WriteLine ("The compiler should complain: Error CS0027 trying to use 'this' outside context.");
15 Console.WriteLine ("Trying to assign i to 'this' outside a method, property or ctr.");