[nem-bug] [Nemerle 0000551]: { } brackets in string interpolation crash compiler

feedback at nemerle.org feedback at nemerle.org
Sun Nov 6 17:43:51 CET 2005


The following issue has been CLOSED
======================================================================
<http://nemerle.org/bugs/view.php?id=551> 
======================================================================
Reported By:                gildur
Assigned To:                nazgul
======================================================================
Project:                    Nemerle
Issue ID:                   551
Category:                   Compiler (parser/macros engine)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             10-19-2005 18:55 CEST
Last Modified:              11-06-2005 17:43 CET
======================================================================
Summary:                    { } brackets in string interpolation crash compiler
Description: 
I tried to compile following code:
------
using System;

public module Lists
{
    public Head[T](l : list[T]) : T
    {
        match (l)
        {
            | x :: _ => x
            | [] => throw ArgumentException("List too short.")
        }
    }

    public Tail[T](l : list[T]) : list[T]
    {
        match (l)
        {
            | _ :: xs => xs
            | [] => []
        }
    }
}

def l = [1, 2, 3];
Console.WriteLine($"List: ${l}");
Console.WriteLine($"Head: ${Lists.Head(l)}");
Console.WriteLine($"Tail: ${Lists.Tail(l)}");
------
And i got following error:
error: internal compiler error: got some unknown exception of type
System.IndexOutOfRangeException: Array index is out of range.
in <0x001fd> Nemerle.Compiler.NamespaceTree+Node:TryPath
(Nemerle.Core.list`1 n)
<rest of stack trace here>

Expected result: rejecting this code with a hint to change { } to ( ) in
string
interpolation code.
======================================================================

----------------------------------------------------------------------
 nazgul - 10-19-05 22:40 
----------------------------------------------------------------------
Fixed on trunk (r5833).

We do not reject the code, but print the warning and treat $ as standard
character.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
10-19-05 18:55 gildur         New Issue                                    
10-19-05 22:40 nazgul         Status                   new => resolved     
10-19-05 22:40 nazgul         Resolution               open => fixed       
10-19-05 22:40 nazgul         Assigned To               => nazgul          
10-19-05 22:40 nazgul         Note Added: 0000999                          
10-19-05 22:40 nazgul         Description Updated                          
11-06-05 17:43 nazgul         Status                   resolved => closed  
======================================================================




More information about the bugs mailing list