[nem-bug] [Nemerle 0000739]: Try block is not allowed inside expressions

feedback at nemerle.org feedback at nemerle.org
Mon Aug 14 21:58:31 CEST 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=739> 
======================================================================
Reported By:                Snaury
Assigned To:                nazgul
======================================================================
Project:                    Nemerle
Issue ID:                   739
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             08-14-2006 21:52 CEST
Last Modified:              08-14-2006 21:58 CEST
======================================================================
Summary:                    Try block is not allowed inside expressions
Description: 
// 1.n
// REFERENCE: Nemerle.Compiler
using Nemerle.Compiler;

def transform(l, r = []) {
  match(l) {
    | _ :: xs =>
      transform(xs, Util.locate(Location.Default, <[ null ]>) :: r)
    | _ => r.Rev()
  }
}

def p = transform([1, 2, 3, 4]);
System.Console.WriteLine(p.ToString());

// nbuild 1.n
ncc.exe -no-color -r:Nemerle.Compiler -out:1.exe 1.n
1.n:8:21:8:32: error: try block is not allowed inside expressions
1.n:8:21:8:32: error: try-blocks cannot be used inside expressions, this
message shouldn't happen though
error: child process exited abnormally
... while compiling 1.n

Huh? Why can't try block be used here?
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
duplicate of        0000259 cannot strore result of a try block
======================================================================

----------------------------------------------------------------------
 nazgul - 08-14-06 21:55 
----------------------------------------------------------------------
Because you can't have not-empty stack when the try block is opened at IL
level (that is, such code does not verify).
We do some simple optimizations, so sometimes it will work, but in general
you just can't do this.

----------------------------------------------------------------------
 nazgul - 08-14-06 21:58 
----------------------------------------------------------------------
Dupe.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
08-14-06 21:52 Snaury         New Issue                                    
08-14-06 21:55 nazgul         Note Added: 0001417                          
08-14-06 21:58 nazgul         Relationship added       duplicate of 0000259
08-14-06 21:58 nazgul         Duplicate ID             0 => 259            
08-14-06 21:58 nazgul         Status                   new => resolved     
08-14-06 21:58 nazgul         Resolution               open => fixed       
08-14-06 21:58 nazgul         Assigned To               => nazgul          
08-14-06 21:58 nazgul         Note Added: 0001420                          
======================================================================




More information about the bugs mailing list