From: Peter Gummer To: bugs@support.eiffel.com Cc: Subject: RE: EiffelStudio/4045 - Assignment attempt should be Void, but ev entually causes InvalidCastException in .NET Date: Tue, 5 Apr 2005 09:13:24 +1000 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C5396B.E6F0C5B0 Content-Type: text/plain Hi, This error is still happening in 5.6.0721. - Peter Gummer -----Original Message----- From: bugs@berkeley.eiffel.com [mailto:bugs@berkeley.eiffel.com] Sent: Wednesday, 22 September 2004 10:24 To: pgummer@decisions-made-easy.com.au Subject: EiffelStudio/4045 Thank you very much for your problem report. It has the internal identification `EiffelStudio/4045'. If you want to add more information to your report or reply to our answer, please reply to this message without modifying the subject header. The individual assigned to look at your report is: EiffelStudio_team. >Category: EiffelStudio >Responsible: EiffelStudio_team >Synopsis: Assignment attempt should be Void, but eventually causes InvalidCastException in .NET >Arrival-Date: Tue Sep 21 17:24:00 PDT 2004 >Severity: serious >Priority: high >Confidential: no >Environment: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 >Description: I've run into an invalid cast exception while running a .NET application that I'm developing. The bug is demonstrated by the the classes below. These same classes behave correctly in a classic application. This looks a bit like a catcall, but it isn't. The actual type of 'p' is CHILD. The assignment attempt (p ?= a) tries to store a CHILD2 object in p. In a classic application, p is Void. But in .NET, it merrily sets the CHILD2 object, and when the caller tries to access the wrongly assigned 'p' it throws an InvalidCastException. >How-To-Repeat: class APPLICATION create make feature {NONE} make is local b: BUG [CHILD] c: CHILD do create b.make (create {CHILD2}) c := b.p -- InvalidCastException in .NET end end class PARENT end class CHILD inherit PARENT end class CHILD2 inherit PARENT end class BUG [reference G -> PARENT] create make feature {NONE} make (a: PARENT) is do p ?= a end -- Should be Void feature p: G end ------_=_NextPart_001_01C5396B.E6F0C5B0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable RE: EiffelStudio/4045 - Assignment attempt should be Void, but = eventually causes InvalidCastException in .NET

Hi,

This error is still happening in 5.6.0721.

- Peter Gummer


-----Original Message-----
From: bugs@berkeley.eiffel.com [mailto:bugs@berkeley.eiffel.com= ]
Sent: Wednesday, 22 September 2004 10:24
To: pgummer@decisions-made-easy.com.au
Subject: EiffelStudio/4045

Thank you very much for your problem report.
It has the internal identification = `EiffelStudio/4045'.

If you want to add more information to your report = or
reply to our answer, please reply to this = message
without modifying the subject header.

The individual assigned to look at your
report is: EiffelStudio_team.

>Category:       = EiffelStudio
>Responsible:    = EiffelStudio_team
>Synopsis:       = Assignment attempt should be Void, but eventually causes = InvalidCastException in .NET
>Arrival-Date:   Tue Sep 21 17:24:00 = PDT 2004
>Severity:       = serious
>Priority:       = high
>Confidential:   no
>Environment:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; = rv:1.7) Gecko/20040626 Firefox/0.9.1

>Description:
I've run into an invalid cast exception while = running a .NET application
that I'm developing. The bug is demonstrated by the = the classes below. These
same classes behave correctly in a classic = application.

This looks a bit like a catcall, but it isn't. The = actual type of 'p' is
CHILD. The assignment attempt (p ?=3D a) tries to = store a CHILD2 object in p.
In a classic application, p is Void. But in .NET, it = merrily sets the CHILD2
object, and when the caller tries to access the = wrongly assigned 'p' it
throws an InvalidCastException.


>How-To-Repeat:
class APPLICATION
      create make
      feature {NONE} make = is
          &nb= sp; local
          &nb= sp;       b: BUG [CHILD]
          &nb= sp;       c: CHILD
          &nb= sp; do
          &nb= sp;       create b.make (create = {CHILD2})
          &nb= sp;       c :=3D b.p -- = InvalidCastException in .NET
          &nb= sp; end
end

class PARENT end

class CHILD inherit PARENT end

class CHILD2 inherit PARENT end

class BUG [reference G -> PARENT]
      create make
      feature {NONE} make = (a: PARENT) is
          &nb= sp; do p ?=3D a end -- Should be Void
      feature p: G
end

------_=_NextPart_001_01C5396B.E6F0C5B0--