Skip to content

Commit 9ba24be

Browse files
paulirwinclaude
andcommitted
Add test for generic-arity stripping in nested inferred type names (#1022)
Covers the BUG-4 fix in GetInferredLuceneTypeName (commit 9fc36a4) where the back-tick arity is stripped from each enclosing declaring-type name, not just the leaf, so a type nested under a generic outer (PairOutputs<A,B>.Pair) infers "PairOutputs.Pair" rather than "PairOutputs`2.Pair". This test lives in the main Lucene.Net test project alongside the other GetInferredLuceneTypeName cases, since the change is in the shipping Lucene.Net assembly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3be4db0 commit 9ba24be

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Lucene.Net.Tests/Support/Reflection/TestReflectionTypeExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Lucene.Net.Index;
33
using Lucene.Net.Search;
44
using Lucene.Net.Util;
5+
using Lucene.Net.Util.Fst;
56
using NUnit.Framework;
67
using System;
78

@@ -41,6 +42,7 @@ public void TestGetLuceneTypeInfo_PackageNames(Type luceneNetType, string expect
4142
[TestCase(typeof(Field), "Field")] // test package mapping attribute
4243
[TestCase(typeof(ReferenceContext<>), "ReferenceContext")] // this type doesn't actually exist in Lucene, but it tests the generic type erasure
4344
[TestCase(typeof(FieldCache.CacheEntry), "FieldCache.CacheEntry")] // test nested type
45+
[TestCase(typeof(PairOutputs<object, object>.Pair), "PairOutputs.Pair")] // nested type under a generic outer: arity stripped from the enclosing name too
4446
[TestCase(typeof(IAttribute), "Attribute")] // test interface
4547
public void TestGetInferredLuceneTypeName(Type luceneNetType, string expectedName)
4648
{

0 commit comments

Comments
 (0)