File tree Expand file tree Collapse file tree
src/libraries/TedToolkit.RoslynHelper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project >
33 <PropertyGroup >
4- <Version >2025.12.23.0 </Version >
4+ <Version >2025.12.23.1 </Version >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 <LangVersion >preview</LangVersion >
Original file line number Diff line number Diff line change 1- using Microsoft . CodeAnalysis ;
1+ using System . Runtime . CompilerServices ;
2+ using Microsoft . CodeAnalysis ;
23using Microsoft . CodeAnalysis . CSharp ;
34using Microsoft . CodeAnalysis . CSharp . Syntax ;
45using TedToolkit . RoslynHelper . Names ;
@@ -133,7 +134,25 @@ public static AttributeListSyntax GeneratedCodeAttribute(Type generator)
133134 /// <returns></returns>
134135 public static AttributeSyntax NonUserCodeAttribute ( )
135136 {
136- return Attribute ( IdentifierName ( "global::System.Diagnostics.DebuggerNonUserCode" ) ) ;
137+ return Attribute ( IdentifierName ( "global::System.Diagnostics.DebuggerNonUserCodeAttribute" ) ) ;
138+ }
139+
140+ /// <summary>
141+ /// Method Impl Attribute
142+ /// </summary>
143+ /// <param name="methodImplOptions"></param>
144+ /// <returns></returns>
145+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
146+ public static AttributeSyntax MethodImplAttribute ( MethodImplOptions methodImplOptions )
147+ {
148+ return Attribute ( IdentifierName ( "global::System.Runtime.CompilerServices.MethodImplAttribute" ) )
149+ . WithArgumentList ( AttributeArgumentList (
150+ [
151+ AttributeArgument ( MemberAccessExpression (
152+ SyntaxKind . SimpleMemberAccessExpression ,
153+ IdentifierName ( "global::System.Runtime.CompilerServices.MethodImplOptions" ) ,
154+ IdentifierName ( "AggressiveInlining" ) ) )
155+ ] ) ) ;
137156 }
138157
139158 /// <summary>
Original file line number Diff line number Diff line change @@ -89,9 +89,7 @@ public ParameterSyntax ParameterSyntax
8989
9090 if ( value == null )
9191 {
92- return type . IsValueType
93- ? LiteralExpression ( SyntaxKind . DefaultLiteralExpression )
94- : LiteralExpression ( SyntaxKind . NullLiteralExpression ) ;
92+ return LiteralExpression ( SyntaxKind . DefaultLiteralExpression ) ;
9593 }
9694
9795 switch ( type . SpecialType )
You can’t perform that action at this time.
0 commit comments