Skip to content

Commit 30397a5

Browse files
authored
Merge pull request #75 from Ted-Jin-Lab/development
🐛Fix parameter modifiers handling for ref, out, in, and scoped parame…
2 parents 4f3b51a + 2d4de62 commit 30397a5

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<Version>2025.12.9.0</Version>
4+
<Version>2025.12.12.0</Version>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<LangVersion>preview</LangVersion>

src/libraries/TedToolkit.RoslynHelper/Names/ParameterName.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,22 @@ public ParameterSyntax ParameterSyntax
3838
get
3939
{
4040
var param = Parameter(Identifier(Name)).WithType(IdentifierName(Type.FullName));
41+
42+
if (Symbol.ScopedKind is ScopedKind.ScopedValue)
43+
{
44+
param = param.AddModifiers(Token(SyntaxKind.ScopedKeyword));
45+
}
46+
4147
switch (Symbol.RefKind)
4248
{
4349
case RefKind.Ref:
44-
param = param.WithModifiers(TokenList(Token(SyntaxKind.RefKeyword)));
50+
param = param.AddModifiers(Token(SyntaxKind.RefKeyword));
4551
break;
4652
case RefKind.Out:
47-
param = param.WithModifiers(TokenList(Token(SyntaxKind.OutKeyword)));
53+
param = param.AddModifiers(Token(SyntaxKind.OutKeyword));
4854
break;
4955
case RefKind.In:
50-
param = param.WithModifiers(TokenList(Token(SyntaxKind.InKeyword)));
56+
param = param.AddModifiers(Token(SyntaxKind.InKeyword));
5157
break;
5258
case RefKind.None:
5359
case RefKind.RefReadOnlyParameter:

0 commit comments

Comments
 (0)