From da0abfe5d010e02808ef0dbba1135cd4d402fd47 Mon Sep 17 00:00:00 2001 From: BobLd <38405645+BobLd@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:43:47 +0000 Subject: [PATCH] Fix warnings about "type 'K' cannot be used as type parameter 'TKey' in the generic type or method 'Dictionary'" --- src/UglyToad.PdfPig/PdfFonts/Cmap/CMapUtils.cs | 2 +- src/UglyToad.PdfPig/Util/StackDictionary.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UglyToad.PdfPig/PdfFonts/Cmap/CMapUtils.cs b/src/UglyToad.PdfPig/PdfFonts/Cmap/CMapUtils.cs index d5c0fd6fc..26e1dbad5 100644 --- a/src/UglyToad.PdfPig/PdfFonts/Cmap/CMapUtils.cs +++ b/src/UglyToad.PdfPig/PdfFonts/Cmap/CMapUtils.cs @@ -16,7 +16,7 @@ public static int ToInt(this ReadOnlySpan data) return code; } - public static void PutAll(this Dictionary target, IReadOnlyDictionary source) + public static void PutAll(this Dictionary target, IReadOnlyDictionary source) where TKey : notnull { foreach (var pair in source) { diff --git a/src/UglyToad.PdfPig/Util/StackDictionary.cs b/src/UglyToad.PdfPig/Util/StackDictionary.cs index 4b91e06ce..4b521439b 100644 --- a/src/UglyToad.PdfPig/Util/StackDictionary.cs +++ b/src/UglyToad.PdfPig/Util/StackDictionary.cs @@ -5,7 +5,7 @@ namespace UglyToad.PdfPig.Util using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; - internal class StackDictionary + internal class StackDictionary where K : notnull { private readonly List> values = new List>();