Bug 32894

Summary: Using-alias-directives throws NullReferenceException (Mono.CSharp)
Product: [Mono] Compilers Reporter: Patrik Svensson <patrik>
Component: C#Assignee: Marek Safar <masafa>
Severity: normal CC: mono-bugs+mono, sandy
Priority: ---    
Version: 4.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description Patrik Svensson 2015-08-08 21:28:30 UTC
I noticed that I cannot use using-alias-directives with the Evaluator I got from the Mono.CSharp NuGet package.

In the example below, the third 'evaluator.Run' expression will throw, but only if I've declared a using-alias-directive before it.

using Mono.CSharp;
namespace TestApplication
    public class Program
        public static void Main()
            var evaluator = new Evaluator(
                new CompilerContext(
                    new CompilerSettings(), 
                    new ConsoleReportPrinter()));

            evaluator.Run("using System;");
            evaluator.Run("using MyConsole = System.Console;");
            evaluator.Run("Console.WriteLine(\"Hello World\")"); // Throws

Not sure if this bug report belongs in the correct section or not.
Comment 1 Marek Safar 2015-11-10 10:56:50 UTC
Fixed in master