rsdn/nemerle — Issue #242: function default parameter in local function fails
Author: CodingUnit
Created: 2012-01-13 13:25:20+00:00
State: open

This code fails to compile:
```nemerle
using System;
using System.Console;
using Nemerle;

module Test
{
Main() : void
{
// here we use default parameter function
def check(mess, cond = () => true)
{
if (cond()) WriteLine($"test $mess"); else WriteLine("false")
}

def test1()
{
check("Testing small letter type binding")
}

def test2()
{
check("Testing small and high letter type binding")
}

test1();
test2();
}

}
```
with error:
```
error : internal compiler error: assertion ``False'' failed in file ncc\typing\LocalValue.n, line 151: a local function _N_lambda__4128
в Nemerle.Compiler.LocalValue.Register() в e:\OpenSource\Nemerle\Nemerle\ncc\typing\LocalValue.n:строка 152
в Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr) в e:\OpenSource\Nemerle\Nemerle\ncc\typing
\Typer2.n:строка 924
....
....
в Nemerle.Compiler.TypesManager.EmitDecls() в e:\OpenSource\Nemerle\Nemerle\ncc\generation\HierarchyEmitter.n:строка 266
в Nemerle.Compiler.ManagerClass.Run() в e:\OpenSource\Nemerle\Nemerle\ncc\passes.n:строка 620
в Nemerle.CommandlineCompiler.MainClass.main_with_catching() в e:\OpenSource\Nemerle\Nemerle\ncc\main.n:строка 132
```