Bug 28296

Summary: mcs incorrectly reports CS0188: The `this' object cannot be used before all of its fields are assigned
Product: [Mono] Compilers Reporter: Alexander Köplinger <alex.koeplinger>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 3.12.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: decimal.cs

Description Alexander Köplinger 2015-03-21 18:18:21 UTC
Created attachment 10443 [details]
decimal.cs

Compile the attached file with:

> mcs decimal.cs /target:library /nostdlib

an error is shown:

> decimal.cs(53,13): error CS0188: The `this' object cannot be used before all of its fields are assigned to
> Compilation failed: 1 error(s), 0 warnings

The file compiles fine with csc.exe on Windows.

Note: this code is a reduced form of the Decimal class in MS referencesource. When Miguel imported that code into Mono he had to work around the mcs constructor bug in https://github.com/mono/referencesource/commit/9c6e5e2ee332d23c8d07e311c234337205d22642.
Comment 1 Marek Safar 2015-03-25 13:00:03 UTC
Fixed in master