# -compiler-options:-v
TEST_PATTERN = 'v4'
-TESTER_OPTIONS = -compiler-options:"-v -d:NET_4_0;NET_4_5"
+TESTER_OPTIONS = -compiler-options:"-v --break-on-ice -d:NET_4_0;NET_4_5"
COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
--- /dev/null
+// CS0117: `X' does not contain a definition for `P'
+// Line: 11
+
+class X
+{
+ public void Test ()
+ {
+ Foo ();
+ }
+
+ public static void Foo (string Product = X.P)
+ {
+ }
+}
\ No newline at end of file
}
}
- if (ec.IsUnsafe) {
- var target_pc = target_type as PointerContainer;
- if (target_pc != null) {
- if (expr_type.IsPointer) {
- //
- // Pointer types are same when they have same element types
- //
- if (expr_type == target_pc)
- return expr;
+ var target_pc = target_type as PointerContainer;
+ if (target_pc != null) {
+ if (expr_type.IsPointer) {
+ //
+ // Pointer types are same when they have same element types
+ //
+ if (expr_type == target_pc)
+ return expr;
- if (target_pc.Element.Kind == MemberKind.Void)
- return EmptyCast.Create (expr, target_type);
+ if (target_pc.Element.Kind == MemberKind.Void)
+ return EmptyCast.Create (expr, target_type);
//return null;
- }
-
- if (expr_type == InternalType.NullLiteral)
- return new NullPointer (target_type, loc);
}
+
+ if (expr_type == InternalType.NullLiteral)
+ return new NullPointer (target_type, loc);
}
if (expr_type == InternalType.AnonymousMethod){
return e;
} catch (Exception ex) {
- if (loc.IsNull || ec.Module.Compiler.Settings.DebugFlags > 0 || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException ||
+ if (loc.IsNull || ec.Module.Compiler.Settings.BreakOnInternalError || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException ||
ec.Report.Printer is NullReportPrinter)
throw;
if (ms != null && ms.IsGeneric) {
if (type_arguments != null) {
var g_args_count = ms.Arity;
- if (g_args_count != type_arguments.Count)
+ if (g_args_count != type_arguments.Count || type_arguments.Arguments == null)
return int.MaxValue - 20000 + System.Math.Abs (type_arguments.Count - g_args_count);
ms = ms.MakeGenericMethod (ec, type_arguments.Arguments);
public void Resolve (ResolveContext rc, Parameter p)
{
var expr = Resolve (rc);
- if (expr == null)
+ if (expr == null) {
+ this.expr = ErrorExpression.Instance;
return;
+ }
expr = Child;
public int VerboseParserFlag;
public int FatalCounter;
public bool Stacktrace;
+ public bool BreakOnInternalError;
#endregion
public bool ShowFullPaths;
" --stacktrace Shows stack trace at error location\n" +
" --timestamp Displays time stamps of various compiler events\n" +
" -v Verbose parsing (for debugging the parser)\n" +
- " --mcs-debug X Sets MCS debugging level to X\n");
+ " --mcs-debug X Sets MCS debugging level to X\n" +
+ " --break-on-ice Breaks compilation on internal compiler error");
}
//
settings.WriteMetadataOnly = true;
return ParseResult.Success;
+ case "--break-on-ice":
+ settings.BreakOnInternalError = true;
+ return ParseResult.Success;
+
default:
if (arg.StartsWith ("--fatal", StringComparison.Ordinal)){
int fatal = 1;
return false;
} catch (Exception e) {
- if (e is CompletionResult || bc.Report.IsDisabled || e is FatalException || bc.Report.Printer is NullReportPrinter)
+ if (e is CompletionResult || bc.Report.IsDisabled || e is FatalException || bc.Report.Printer is NullReportPrinter || bc.Module.Compiler.Settings.BreakOnInternalError)
throw;
if (bc.CurrentBlock != null) {
} else {
bc.Report.Error (587, "Internal compiler error: {0}", e.Message);
}
-
- if (bc.Module.Compiler.Settings.DebugFlags > 0)
- throw;
}
//