Bug 28292

Summary: Internal compiler error when an interpolated string is too long
Product: [Mono] Compilers Reporter: bawNg <bawng>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: bawng, mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description bawNg 2015-03-21 12:50:06 UTC
Reproduced using:

>using System;
>
>public static class Test {
>	public static void Main() {
>		Console.WriteLine($"This should work but the compiler explodes if the string is too long!");
>	}
>}

This fails during compilation:
>error CS0589: Internal compiler error during parsingSystem.IndexOutOfRangeException: Array index is out of range.
>  at Mono.CSharp.Tokenizer.TokenizeInterpolatedString () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Tokenizer.xtoken () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.Tokenizer.token () [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000] in <filename unknown>:0 
>  at Mono.CSharp.CSharpParser.parse () [0x00000] in <filename unknown>:0
Comment 1 Marek Safar 2015-03-25 12:19:55 UTC
Fixed in master and mono 4.0