[nem-bug] [Nemerle 0000702]: [0.9.3] When downcasting IL generates unnecessary .castclass

feedback at nemerle.org feedback at nemerle.org
Sat Jul 1 16:48:14 CEST 2006


The following issue has been SUBMITTED.
======================================================================
<http://nemerle.org/bugs/view.php?id=702> 
======================================================================
Reported By:                Snaury
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   702
Category:                   Compiler
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-01-2006 16:48 CEST
Last Modified:              07-01-2006 16:48 CEST
======================================================================
Summary:                    [0.9.3] When downcasting IL generates unnecessary
.castclass
Description: 
Consider the following code:

  def a = "some string"
  def b = a : object

After compiling and looking at IL I can see that string downcast, for some
strange reason, is compiled into

  .castclass System.Object

which is not only absolutely unnecessary, it also costs time (a quick test
showed that a call to function with .castclass from string to object seems
to be roughly (I'm not sure if I measured correctly) 10 times slower than
just an empty function call) and pollutes IL. For example, C# does not
generates .castclass when it does downcasts.
======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
07-01-06 16:48 Snaury         New Issue                                    
======================================================================




More information about the bugs mailing list