Repository navigation
Fix runtime, analyzer, code-fix, and generator correctness bugs (Phase 1) - #365
Merged
Merged
Conversation
…e 1) - Make BehaviorPipeline stateless across retries, preserve stack traces via ExceptionDispatchInfo, and make BehaviorsCollection/RecordingBehavior/DynamicStuntInterceptor thread-safe - Guard AsyncRegistry continuations and trimming, fix Argument/MethodInvocation/Ref/Stunt.Get/StuntExtensions edge cases, and tighten DefaultEqualityBehavior/TargetBehavior/NotifyPropertyChangeBehavior matching - Guard ObservabilityBehavior Activity lifecycle and return faulted Task/ValueTask from DataAnnotationsBehavior - Fix ST001 title, split missing-generator MSBuild error to ST024, add ST025/ST026/ST027, harden StuntCache.Prune, and fix NamingConvention, SymbolExtensions, SymbolFullNameExtensions, StuntClosure, GenericWrapperAnalyzer, ValidateTypesAnalyzer, AddPartialCodeFix, MemberScaffold, AttributeReplication, and CSharpRewrite Co-authored-by: CodeAlta <noreply@codealta.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 1 of the codebase audit improvements — correctness, thread-safety, and diagnostic fixes across the runtime, analyzers, code fixes, and compiled proxy generator.
Runtime (
src/Stunts,src/Stunts.DynamicProxy,src/Stunts.Extensions,src/Stunts.Package)BehaviorPipeline&BehaviorsCollection: MadeInvokestateless acrossnextcalls (so retry behaviors re-run downstream behaviors), preserved exception stack traces viaExceptionDispatchInfo, enforcedthrowOnExceptionacross all return paths, and switchedBehaviorsCollectionto lock-guarded mutations with a copy-on-write snapshot.AsyncRegistry&Argument: Wrapped continuation completion intry/catch(TrySetException) so invalid casts fault instead of hanging, preservedRegister<T>for trimming via[DynamicDependency], used directIsByRefLike/IsFunctionPointeron.NET 8+, and fixedArgument<T>.ToString()operator precedence.DefaultEqualityBehavior,TargetBehavior, andNotifyPropertyChangeBehavior(ignoring indexers); madeRecordingBehaviorandDynamicStuntInterceptorthread-safe; guardedObservabilityBehaviorActivitylifecycle andActivity.Currentacross async calls; alignedDataAnnotationsBehaviorto return faultedTask/ValueTaskviaAsyncRegistry; fixedRef.Create,MethodInvocation.ToString,Stunt.Get(null)(Stunt.cs/Stunt.vb), and null behavior validation inStuntExtensions.Analyzers, CodeFixes & Generator (
src/Stunts.CodeAnalysis,src/Stunts.CodeFixes,src/Stunts.CompiledProxy)ST001title (Strings.BaseTypeNotFirst.Title), moved the missing-generator MSBuild error inStunts.targetsfromST010toST024, addedST025(static abstractinterface members),ST026(file-local types), andST027(isolated per-stunt generation failures), and added// <auto-generated/>,#nullable enable, and.g.cshint name toSignatureRefGenerator.NamingConvention.GetNamespaceordering,SymbolExtensions.CanBeIntercepted(Task/Task<T>),SymbolFullNameExtensions.GetTypeByFullName(ITypeSymbol?, leading_, generic/jagged arrays),StuntClosure.Substitutefor nested generics inside constructed containing types,GenericWrapperAnalyzerlocal functions,ValidateTypesAnalyzerEnableCompileTimeStunts=falsegating,AddPartialCodeFix(all non-partial ancestors + wrapper invocations), andAddGeneratorAttributeCodeFix(StringComparison.Ordinal).MemberScaffold.ParameterSignatureandINamedTypeSymbolExtensions.SameSignature(RefKind+ generic arity), emittedscopedandallows ref struct(withStructRef<T>support forwhere T : allows ref struct), replicated inheritable interface attributes while skippingDefaultMemberAttribute, fixed multi-variablePromoteEventFields, and isolatedStuntCache.Prune()failures fromStuntCache.Create().Verification
dotnet build /p:UseSharedCompilation=false -m:1) succeeded with 0 errors.dnx --yes retest -- --no-build) passed: 443/443 tests passing (including new regression tests).This pull request was created by CodeAlta.