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

feedback at nemerle.org feedback at nemerle.org
Mon Aug 14 21:55:44 CEST 2006


A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=739> 
======================================================================
Reported By:                Snaury
Assigned To:                
======================================================================
Project:                    Nemerle
Issue ID:                   739
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             08-14-2006 21:52 CEST
Last Modified:              08-14-2006 21:55 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?
======================================================================

----------------------------------------------------------------------
 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.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
08-14-06 21:52 Snaury         New Issue                                    
08-14-06 21:55 nazgul         Note Added: 0001417                          
======================================================================




More information about the bugs mailing list