-// cs0021-2.cs: Cannot apply indexing with [] to an expression of type `Foo'
-// Line: 14
+// CS0021: Cannot apply indexing with [] to an expression of type `G'
+// Line: 8
-using System;
-
-public class Foo {
- private int this[int index] { get { return index; } }
-}
-
-public class Bar {
- public static void Main ()
+public class Foo<G>
+{
+ public static void Bar ()
{
- Foo foo = new Foo ();
- Console.WriteLine (foo[5]);
+ int i = default (G)[0];
}
}
+