[Mono-bugs] [Bug 525760] New: gmcs does not mimic csc behavior with regards to struct constructors
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jul 28 01:47:27 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=525760
Summary: gmcs does not mimic csc behavior with regards to
struct constructors
Classification: Mono
Product: Mono: Compilers
Version: 2.4.x
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: bojanr at brandeis.edu
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=308259)
--> (http://bugzilla.novell.com/attachment.cgi?id=308259)
Test code
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1)
Gecko/20090624 Firefox/3.5 (.NET CLR 4.0.20506) FirePHP/0.3
When writing a struct with a parameterized constructor, csc requires that a
call to the base constructor be made to initialize fields (automatic property
fields, etc.). gmcs does not require this, and compiles the code just fine
without the explicit : this () call. The attached sample code demonstrates the
error, and csc gives the following error messages:
#
H:\>csc test.cs
#
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.
#
#
test.cs(36,5): error CS0188: The 'this' object cannot be used before all of its
#
fields are assigned to
#
test.cs(33,10): error CS0843: Backing field for automatically implemented
#
property 'Test.RelationshipUser.ID' must be fully assigned before
#
control is returned to the caller. Consider calling the default
#
constructor from a constructor initializer.
#
test.cs(33,10): error CS0843: Backing field for automatically implemented
#
property 'Test.RelationshipUser.ScreenName' must be fully assigned
#
before control is returned to the caller. Consider calling the default
#
constructor from a constructor initializer.
#
test.cs(33,10): error CS0843: Backing field for automatically implemented
#
property 'Test.RelationshipUser.Following' must be fully assigned
before
#
control is returned to the caller. Consider calling the default
#
constructor from a constructor initializer.
#
test.cs(33,10): error CS0843: Backing field for automatically implemented
#
property 'Test.RelationshipUser.FollowedBy' must be fully assigned
#
before control is returned to the caller. Consider calling the default
#
constructor from a constructor initializer.
#
test.cs(33,10): error CS0843: Backing field for automatically implemented
#
property 'Test.RelationshipUser.NotificationsFrom' must be fully
#
assigned before control is returned to the caller. Consider calling the
#
default constructor from a constructor initializer.
Reproducible: Always
Steps to Reproduce:
1. Download attached test code.
2. Try to compile with gmcs.
Actual Results:
Success!
Expected Results:
Error similar to csc's.
--
Configure bugmail: http://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.
More information about the mono-bugs
mailing list