New tests.
authorMarek Safar <marek.safar@gmail.com>
Mon, 17 May 2010 09:54:06 +0000 (09:54 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 17 May 2010 09:54:06 +0000 (09:54 -0000)
svn path=/trunk/mcs/; revision=157426

1  2 
mcs/errors/cs0038-2.cs
mcs/errors/cs0119-9.cs
mcs/errors/cs0120-15.cs
mcs/errors/cs0120-16.cs
mcs/errors/cs0171-3.cs
mcs/errors/cs0214-14.cs
mcs/errors/cs1061-3.cs

index fe4d734d30b284218b2a4207cedf3ad08c197de0,fe4d734d30b284218b2a4207cedf3ad08c197de0..1940fc9c3120bebea37743d462b990245e3b7ef3
@@@ -1,17 -1,17 +1,36 @@@
--// cs0038-2.cs: Cannot access a nonstatic member of outer type `X' via nested type `X.Nested'
--// Line: 9
--public enum MyEnum { V = 1 }
++// CS0038: Cannot access a nonstatic member of outer type `Outer' via nested type `Outer.Inner'
++// Line: 33
  
--class X {
--      public MyEnum MyEnum;   
--      class Nested {
--              internal MyEnum D () { 
--                      return MyEnum; 
--              }
++public class Runner
++{
++      string msg;
++
++      public Runner (string s)
++      {
++              msg = s;
++      }
++
++      public string Report ()
++      {
++              return msg;
++      }
++}
++
++public class Outer
++{
++      private Runner r = new Runner ("Outer");
++
++      public Runner Runner
++      {
++              get { return r; }
++              set { r = value; }
        }
--      
--      static int Main () {
--              Nested n = new Nested ();
--              return n.D() == MyEnum.V ? 0 : 1;
++
++      class Inner
++      {
++              public string Check ()
++              {
++                      return Runner.Report ();
++              }
        }
  }
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..573c0e7ec4190947c933b213ddf4b58830d2596f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++// CS0119: Expression denotes a `method group', where a `variable', `value' or `type' was expected
++// Line: 20
++
++using System;
++
++enum Enum
++{
++      Test
++}
++
++class A : Attribute
++{
++      public A (object e)
++      {
++      }
++}
++
++class C
++{
++      [A (Enum.Test)]
++      int Enum ()
++      {
++              return 0;
++      }
++}
diff --cc mcs/errors/cs0120-15.cs
index d89b17afe1122392597ebf16f842de4e7084e437,d89b17afe1122392597ebf16f842de4e7084e437..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,25 -1,25 +1,0 @@@
--// CS0120: An object reference is required to access non-static member `C.Enum()'
--// Line: 20
--
--using System;
--
--enum Enum
--{
--      Test
--}
--
--class A : Attribute
--{
--      public A (object e)
--      {
--      }
--}
--
--class C
--{
--      [A (Enum.Test)]
--      int Enum ()
--      {
--              return 0;
--      }
--}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c88ea34520e0ed798d3494e99859ef6d2503b7c5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,22 @@@
++// CS0120: An object reference is required to access non-static member `App.Test'
++// Line: 15
++
++class App
++{
++      Test a = new Test ();
++
++      public Test Test
++      {
++              get { return a; }
++      }
++
++      public static void Main (string[] args)
++      {
++              Test.Run ();
++      }
++}
++
++class Test
++{
++      public void Run () { }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f6127ab5067ab3fd8d9ed5f98a1fb22f9d1696f3
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,16 @@@
++// CS0171: Field `S<TKey>.key' must be fully assigned before control leaves the constructor
++// Line: 13
++
++public struct S<TKey> {
++      private TKey key;
++
++      public TKey Key {
++              get { return key; }
++              private set { key = value; }
++      }
++              
++      public S (TKey key)
++      {
++              Key = key;
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a8d563c0ae5b20e3c3337beba752a6fc89a8ace2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,13 @@@
++// CS0214: Pointers and fixed size buffers may only be used in an unsafe context
++// Line: 11
++// Compiler options: -unsafe
++
++public class C
++{
++      unsafe int* i;
++      
++      public static void Main ()
++      {
++              var v = new C().i;
++      }
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..34d76c388c26dc0311cef091bc2c0cf4bb47c783
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,19 @@@
++// CS1061: Type `object' does not contain a definition for `Test' and no extension method `Test' of type `object' could be found (are you missing a using directive or an assembly reference?)
++// Line: 17
++
++public class S
++{
++      public static void Test()
++      {
++      }
++}
++
++public class M
++{
++      public object S { get; set; }
++
++      public void Main ()
++      {
++              S.Test ();
++      }
++}