[nem-bug] [Nemerle 0000779]: String concatination

feedback at nemerle.org feedback at nemerle.org
Wed Nov 8 21:23:48 CET 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=779> 
======================================================================
Reported By:                IT
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   779
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             10-30-2006 02:58 CET
Last Modified:              11-08-2006 21:23 CET
======================================================================
Summary:                    String concatination
Description: 
Code:

module Test
{
  Main () : void
  {
    _ = "" + match (1) { | 1 => "" | _ => "" } + ""
  }
}

Error: cannot find the operator `op_UnaryPlus' on string

The following works fine:

module Test
{
  Main () : void
  {
    _ = "" + (match (1) { | 1 => "" | _ => "" }) + ""
  }
}
======================================================================

----------------------------------------------------------------------
 malekith - 11-08-06 21:17 
----------------------------------------------------------------------
This is a parsing problem. The code above is parsed as:

_ = "" + match (1) { | 1 => "" | _ => "" };
+ ""

I'm not quite sure this can be easily changed. As of now the parser always
thinks there is a ';' after '}'

----------------------------------------------------------------------
 nazgul - 11-08-06 21:23 
----------------------------------------------------------------------
Yeah, so I guess we sould close it as "by design" - this feature was done
to make following code patten possible:

def f() {
  while (x) {
    ...
  }
  -count;
}

Issue History
Date Modified  Username       Field                    Change              
======================================================================
10-30-06 02:58 IT             New Issue                                    
11-08-06 21:17 malekith       Note Added: 0001490                          
11-08-06 21:23 nazgul         Note Added: 0001492                          
======================================================================




More information about the bugs mailing list