[nem-bug] [Nemerle 0000756]: 'Internal compiler error' if try use closures in yield-method

feedback at nemerle.org feedback at nemerle.org
Wed Sep 27 18:48:44 CEST 2006


The following issue has been RESOLVED.
======================================================================
<http://nemerle.org/bugs/view.php?id=756> 
======================================================================
Reported By:                VladD2
Assigned To:                malekith
======================================================================
Project:                    Nemerle
Issue ID:                   756
Category:                   Compiler
Reproducibility:            always
Severity:                   minor
Priority:                   high
Status:                     resolved
Resolution:                 fixed
Fixed in Version:           
======================================================================
Date Submitted:             09-16-2006 03:16 CEST
Last Modified:              09-27-2006 18:48 CEST
======================================================================
Summary:                    'Internal compiler error' if try use closures in
yield-method
Description: 
using System;

variant Token
{
	| Number { val : double; }
	| LeftBracket //{ tokens : list[Token] }
	| RightBracket 
	| Plus
	| Minus
	| Mul
	| Div
	| Eof
}

module Program
{
  Main() : void { }
  
  GetToken(text : string) : System.Collections.Generic.IEnumerator[Token]
  {
  	mutable i = 0;
		def peek() { if (text.Length == i) '\0' else text[i] }
		def next() { i++; peek() }
		def getNumber(ch) { if (char.IsDigit(peek())) { ch.ToString() +
getNumber(next()) } else ch.ToString() }
		def scan(ch : char) : Token
		{
			| '+' => Token.Plus()
			| '-' => Token.Minus()
			| '/' => Token.Div()
			| '*' => Token.Mul()
			| '(' => Token.LeftBracket()
			| ')' => Token.RightBracket()
			| ' ' | '\t' | '\r' | '\n'  => scan(next())
			| '\0' => Token.Eof()
			| ch when char.IsDigit(ch) =>
Token.Number(double.Parse(getNumber(ch)))
		}
		
		yield scan(next());
  }
}

-----------------------------------------
internal compiler error: assertion ``False'' failed in file
ncc\generation\Typer3.n, line 445
======================================================================

----------------------------------------------------------------------
 malekith - 09-27-06 18:48 
----------------------------------------------------------------------
Resolved on trunk, r6727.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
09-16-06 03:16 VladD2         New Issue                                    
09-27-06 18:48 malekith       Status                   new => resolved     
09-27-06 18:48 malekith       Resolution               open => fixed       
09-27-06 18:48 malekith       Assigned To               => malekith        
09-27-06 18:48 malekith       Note Added: 0001462                          
======================================================================




More information about the bugs mailing list