[nem-bug] [Nemerle 0000415]: Something is not properly interpreted
when using event without this. prefix
feedback at nemerle.org
feedback at nemerle.org
Wed Nov 29 15:09:49 CET 2006
The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=415>
======================================================================
Reported By: nazgul
Assigned To: malekith
======================================================================
Project: Nemerle
Issue ID: 415
Category: Compiler
Reproducibility: always
Severity: minor
Priority: high
Status: resolved
Resolution: fixed
Fixed in Version:
======================================================================
Date Submitted: 04-19-2005 01:05 CEST
Last Modified: 11-29-2006 15:09 CET
======================================================================
Summary: Something is not properly interpreted when using
event without this. prefix
Description:
using System;
using Gtk;
class MyView :TextView
{
public this()
{
// this fails with stange message, should work
Buffer.InsertText += fun (_) { Console.Write ("hello")
};
// this works as expected
this.Buffer.InsertText += fun (_) { Console.Write
("hello") };
;
}
}
======================================================================
Relationships ID Summary
----------------------------------------------------------------------
has duplicate 0000769 Can't subscribe on event if 'Nemerle.Co...
======================================================================
----------------------------------------------------------------------
nazgul - 04-19-05 15:20
----------------------------------------------------------------------
This is very strange... for
// this fails with stange message, should work
def tmp = Buffer;
Buffer.InsertText = tmp.InsertText + fun (_) { System.Console.Write
("hello") };
// this works as expected
tmp.InsertText = tmp.InsertText + fun (_) { System.Console.Write
("hello") };
-dt gives:
t.n:6:10: debug: MyView..ctor -> void :
base ();
def tmp = this.Buffer;
this.Buffer.InsertText = Gtk.InsertTextHandler.op_Addition
(tmp.InsertText, Gtk.InsertTextHandler (def []_N_l2752 (_N_u411 :
(System.Object * Gtk.InsertTextArgs-)) : void {
System.Console.Write ("hello")
}
_N_l2752));
tmp.InsertText = Gtk.InsertTextHandler.op_Addition (tmp.InsertText,
Gtk.InsertTextHandler (def []_N_l2924 (_N_u412 : (System.Object *
Gtk.InsertTextArgs-)) : void {
System.Console.Write ("hello")
}
_N_l2924))
so everything is correctly interpreted, but fails...
Somehow this.Buffer vs tmp makes a difference
----------------------------------------------------------------------
nazgul - 04-19-05 16:10
----------------------------------------------------------------------
Ok, found the problem:
TheSame method is utterly flawed and it would probably need to consider
infinite number of cases to be correct.
TheSame (Buffer, tmp) will never return true....
----------------------------------------------------------------------
nazgul - 04-19-05 19:27
----------------------------------------------------------------------
The bug triggering this one is in cache_assign_expr (e : PT.PExpr), which
is using
Macros.IsTypeName (..)
The problem is that Buffer is a type name for System.Buffer, but at the
same time it is this.Buffer - macro creates code for Buffer being type
name.
----------------------------------------------------------------------
malekith - 11-29-06 15:09
----------------------------------------------------------------------
Resolved on trunk, r7016 (also resolves
http://nemerle.org/bugs/view.php?id=769).
Issue History
Date Modified Username Field Change
======================================================================
04-19-05 01:05 nazgul New Issue
04-19-05 01:13 rodrigob Issue Monitored: rodrigob
04-19-05 01:15 nazgul Priority normal => high
04-19-05 01:15 nazgul Description Updated
04-19-05 01:15 nazgul Additional Information Updated
04-19-05 15:20 nazgul Note Added: 0000704
04-19-05 16:10 nazgul Note Added: 0000705
04-19-05 19:27 nazgul Note Added: 0000706
04-23-05 14:47 nazgul Status new => confirmed
11-29-06 15:09 malekith Relationship added has duplicate 0000769
11-29-06 15:09 malekith Status confirmed => resolved
11-29-06 15:09 malekith Resolution open => fixed
11-29-06 15:09 malekith Assigned To => malekith
11-29-06 15:09 malekith Note Added: 0001532
======================================================================
More information about the bugs
mailing list