diff --git a/src/ComputeSharp.D2D1Interop/Shaders/Translation/D2D1ShaderCompiler.cs b/src/ComputeSharp.D2D1Interop/Shaders/Translation/D2D1ShaderCompiler.cs
index c0f9e910..68da8cf6 100644
--- a/src/ComputeSharp.D2D1Interop/Shaders/Translation/D2D1ShaderCompiler.cs
+++ b/src/ComputeSharp.D2D1Interop/Shaders/Translation/D2D1ShaderCompiler.cs
@@ -1,5 +1,6 @@
using System;
using System.Buffers;
+using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@@ -204,8 +205,9 @@ internal static unsafe class D2D1ShaderCompiler
///
/// The input (faulting) operation.
/// This method always throws and never actually returs.
+ [DoesNotReturn]
[MethodImpl(MethodImplOptions.NoInlining)]
- private static ComPtr ThrowHslsCompilationException(ID3DBlob* d3DOperationResult)
+ private static void ThrowHslsCompilationException(ID3DBlob* d3DOperationResult)
{
string message = new((sbyte*)d3DOperationResult->GetBufferPointer());