You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -418,4 +418,5 @@ async\method: Suffix with `Async` =\> `GetDataAsync()`
418
418
419
419
- Expression compilation can emit invalid IL on some runtimes; fall back to `Compile(preferInterpretation: true)` when evaluating expressions to avoid CI-only `InvalidProgramException`.
420
420
- Byref-like expression trees (e.g., `Span<T>`, `ReadOnlySpan<T>`) cannot be boxed; convert them to arrays before evaluation to avoid interpreter type load errors.
421
+
- Reflection helpers should tolerate missing overloads (e.g., `MemoryExtensions.ToArray`) to prevent type initializer failures on runtimes where a method shape differs.
421
422
-`NUnit.Assert.ThrowsAsync<T>()` returns the exception instance (not a `Task`), so async tests should await a real async assertion (e.g., `action.Should().ThrowAsync<T>()`) to avoid CS1998 warnings.
Copy file name to clipboardExpand all lines: learnings.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,7 @@ This document is organized by topic to consolidate key learnings about the proje
129
129
-**DynamicInvoke Cross-Platform Issues:** Using `Expression.Lambda(expression).Compile().DynamicInvoke()` can fail on CI/certain runtimes with `NotSupportedException: Specified method is not supported` - use strongly-typed `Expression.Lambda<Func<object>>(Expression.Convert(expression, typeof(object))).Compile()()` for direct invocation without reflection
130
130
-**Expression.Compile InvalidProgramException:** Expression compilation can emit invalid IL on some runtimes; prefer `Compile(preferInterpretation: true)` or catch `InvalidProgramException` and recompile in interpreted mode to ensure value extraction works on CI
131
131
-**ByRef-like expression evaluation:** Ref structs (e.g., `Span<T>`, `ReadOnlySpan<T>`) cannot be boxed to `object`; convert them to arrays (e.g., `MemoryExtensions.ToArray`) before value extraction to avoid interpreter `TypeLoadException`/`ArgumentException`.
132
+
-**Reflection resilience:** Do not assume specific overloads exist across runtimes; when reflecting for helpers like `MemoryExtensions.ToArray`, select via tolerant predicate and allow null fallback to avoid type initializer failures.
132
133
-**NUnit Assert.ThrowsAsync return type:**`Assert.ThrowsAsync<T>()` returns the exception instance, not a `Task`, so async test methods need an explicit awaitable (e.g., `action.Should().ThrowAsync<T>()`) to avoid CS1998 warnings.
0 commit comments