https://bugzilla.novell.com/show_bug.cgi?id=460016
Summary: Mix up between a type and outer type properties.
Product: Mono: Compilers
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: ---
The following code compiles with both MCS and GMCS but not with CSC.
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
nestor.cs(31,11): error CS0120: An object reference is required for the
non-static field, method, or property 'Runner.Report()'
nestor.cs(12,16): (Location of symbol related to previous error)
-----------------------------------------------------------------------------
using System;
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; }
}
class Inner {
public string Check ()
{
return Runner.Report ();
}
}
static void Main ()
{
Console.WriteLine (new Inner ().Check ());
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs