Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 09-12-2007
kwaclaw kwaclaw is offline
Registered User
 
Name: Karl Waclawek
Organization: Toronto Star Newspapers Ltd.
Project: Proof of concept
 
Join Date: Sep 2004
Location: Oshawa, Canada
Posts: 136
structs and ["clr:property"]

When the directive ["clr: property"] is used with structs, incorrect code is generated. Given this Slice definition:

Code:
["clr:property"]
struct Date {
  byte Day;
  byte Month;
  short Year;
};
The code generated for the struct constructor does not compile, returning the error "'this' object cannot be used before all of its fields are assigned to":

Code:
public Date(byte Day, byte Month, short Year)
{
    this.Day = Day;
    this.Month = Month;
    this.Year = Year;
}
The assigments should be made to the fields, not the properties.

Btw, is there a reason why private fields and method parameters in the C# code are capitalized? This is a very uncommon code style for C#.

Karl
__________________
Karl Waclawek
The Toronto Star - http://www.thestar.com

Last edited by kwaclaw : 09-12-2007 at 11:14 AM. Reason: Typo
Reply With Quote
  #2 (permalink)  
Old 09-12-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
Quote:
Originally Posted by kwaclaw View Post
When the directive ["clr: property"] is used with structs, incorrect code is generated.
Thanks for the bug report! I'll have a look at this.

Quote:
Btw, is there a reason why private fields and method parameters in the C# code are capitalized? This is a very uncommon code style for C#.
They use whatever capitalization you use for the corresponding Slice identifier.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 09-24-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 909
I've posted a patch for this. Thanks for reporting the problem!

Cheers,

Michi.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't "Ice-3.1.1-VC71.msi " include the "slice2java.exe"? Jason Gao Help Center 4 10-26-2006 12:23 PM
"make test" failure on Ice 3.0.1 installation. SUSE 10.1. pchapin Help Center 4 05-22-2006 11:20 PM
IceGrid startup performance and CPU usage "problem" kovacm Comments 11 12-06-2005 07:52 AM
Unknown property "IceBox.DBEnvName.IceStorm" for IceStorm wwwtiger Help Center 1 11-05-2004 03:23 PM
Going from "in" to "out" param, using a class as a union catalin Help Center 1 04-05-2004 09:55 AM


All times are GMT -4. The time now is 07:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.