RemObjects
                        Software Gears code

C# to Oxygene

Sign in or create your account | Project List | Help

Issue 45: Event Assignment Operators Converted Incorrectly

Reported by Jamie I, Apr 28, 2009

Event Assignment Operators are converted rather too literally, 
consider the following C# code:

			this._connection.OnDataReceived += new 
EventHandler<TcpDataEventArgs>(DataReceived);
			this._connection.OnErrorOccurred += new 
EventHandler<TcpErrorEventArgs>(ErrorOccurred);

Which is converted to: 

  this._connection.OnDataReceived := this._connection.OnDataReceived 
+ new EventHandler<TcpDataEventArgs>(DataReceived);
  this._connection.OnErrorOccurred := 
this._connection.OnErrorOccurred + new 
EventHandler<TcpErrorEventArgs>(ErrorOccurred)


When it should really be converted to:

  // Ignore the altered event assignment from above.
  Self._connection.OnDataReceived += @Self.DataReceived;
  Self._connection.OnErrorOccurred += @Self.ErrorOccurred;

Comment 1 by Jamie I, Apr 28, 2009

Apologies - Please close this, I've just seen that it's a dupe of 
Issue #37 marked as WontFix.

Comment 2 by Carlo Kok, Jun 8, 2009

Status: Duplicate
Owner: carlokok

Created: 1 year 3 months ago by Jamie I

Updated: 1 year 1 month ago

Status: Duplicate

Owner: Carlo Kok

Labels:
Priority:Medium
Type:Defect