Skip to content

Commit 15cad32

Browse files
committed
Merge branch 'bugfix/msbuild-task-message-null' into develop
2 parents a76579e + 05c39eb commit 15cad32

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/IKVM.MSBuild.Tasks/IkvmToolTaskDiagnosticWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public async ValueTask ReceiveAsync(IkvmToolDiagnosticEvent @event, Cancellation
5454
logger.LogWarning(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
5555
break;
5656
case IkvmToolDiagnosticEventLevel.Error:
57-
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, MessageImportance.Normal, @event.Message, @event.Args);
57+
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
5858
break;
5959
case IkvmToolDiagnosticEventLevel.Fatal:
60-
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, MessageImportance.High, @event.Message, @event.Args);
60+
logger.LogError(null, $"{@event.Id:D4}", null, null, @event.Location.StartLine, @event.Location.StartColumn, @event.Location.EndLine, @event.Location.EndColumn, @event.Message, @event.Args);
6161
break;
6262
}
6363

src/IKVM.Runtime/MethodAnalyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ private void ConditionalPatchNoClassDefFoundError(ref ClassFile.Method.Instructi
24852485
private void SetHardError(RuntimeClassLoader classLoader, ref ClassFile.Method.Instruction instruction, HardError hardError, string message, params object[] args)
24862486
{
24872487
string text = string.Format(message, args);
2488-
#if IMPORTER
2488+
24892489
switch (hardError)
24902490
{
24912491
case HardError.NoClassDefFoundError:
@@ -2518,7 +2518,7 @@ private void SetHardError(RuntimeClassLoader classLoader, ref ClassFile.Method.I
25182518
default:
25192519
throw new InvalidOperationException();
25202520
}
2521-
#endif
2521+
25222522
instruction.SetHardError(hardError, AllocErrorMessage(text));
25232523
}
25242524

src/IKVM.Runtime/compiler.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2565,7 +2565,6 @@ void Compile(Block block, int startIndex)
25652565
}
25662566

25672567
var message = harderrors[instr.HardErrorMessageId];
2568-
clazz.ClassLoader.Diagnostics.GenericCompilerError($"{exceptionType.Name}: {message}\n\tat {classFile.Name}.{m.Name}{m.Signature}");
25692568
ilGenerator.Emit(OpCodes.Ldstr, message);
25702569
RuntimeJavaMethod method = exceptionType.GetMethodWrapper("<init>", "(Ljava.lang.String;)V", false);
25712570
method.Link();

src/IKVM.Tools.Importer/ImportContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ void ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, I
569569

570570
if (options.NoWarn != null)
571571
foreach (var diagnostic in options.NoWarn)
572-
compilerOptions.suppressWarnings.Add($"IKVM{diagnostic.Id:D4}");
572+
compilerOptions.suppressWarnings.Add(diagnostic.Id.ToString());
573573

574574
// TODO handle specific diagnostic IDs
575575
if (options.WarnAsError != null)
@@ -578,7 +578,7 @@ void ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, I
578578
compilerOptions.warnaserror = true;
579579
else
580580
foreach (var i in options.WarnAsError)
581-
compilerOptions.errorWarnings.Add($"IKVM{i.Id:D4}");
581+
compilerOptions.errorWarnings.Add(i.Id.ToString());
582582
}
583583

584584
if (options.Runtime != null)

0 commit comments

Comments
 (0)