Skip to content

Commit fd190b5

Browse files
authored
Merge pull request #702 from stakx/csharp-lang-version-14
Switch to C# language version 14
2 parents 4e6eec9 + 4f624b0 commit fd190b5

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
dotnet-version: |
2929
8.0.x
3030
9.0.x
31+
10.0.x
3132
3233
# -----
3334
# Build

appveyor.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ for:
1818
only:
1919
- image: Ubuntu2204
2020

21+
# install .NET 10 SDK
22+
install:
23+
- curl -L https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
24+
- chmod +x ./dotnet-install.sh
25+
- sudo ./dotnet-install.sh --channel 10.0 --install-dir /usr/share/dotnet
26+
2127
# build and run tests
2228
build_script:
2329
- uname -a
@@ -46,6 +52,10 @@ for:
4652
Update-AppveyorBuild -Version ($env:APPVEYOR_REPO_TAG_NAME).TrimStart("v")
4753
}
4854
55+
# install .NET 10 SDK
56+
install:
57+
- cmd: choco install dotnet-10.0-sdk
58+
4959
# build and run tests
5060
build_script:
5161
- cmd: build.cmd

buildscripts/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<LangVersion>13.0</LangVersion>
4+
<LangVersion>14.0</LangVersion>
55
<NoWarn>$(NoWarn);CS1591;CS3014;CS3003;CS3001;CS3021</NoWarn>
66
<NoWarn>$(NoWarn);CS0612;CS0618</NoWarn> <!-- TODO: Remove this line once `[Obsolete]` members have been dealt with. -->
77
<RepositoryType>git</RepositoryType>

src/Castle.Core.Tests/DynamicProxy.Tests/CustomModifiersTestCase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void ReflectionReturnsCorrectModoptOnParamTypeForGeneratedType(string typ
150150

151151
var modopts = this.generatedTypes[typeName].GetMethod("Foo").GetParameters()[0].GetOptionalCustomModifiers();
152152

153-
CollectionAssert.AreEqual(expected: CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix].Reverse(), actual: modopts);
153+
CollectionAssert.AreEqual(expected: Enumerable.Reverse(CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix]), actual: modopts);
154154
// ^ The emission of custom modifiers performed by DynamicProxy is currently geared towards
155155
// the CLR, which reports custom modifiers in reverse order. On Mono, before version 5.16,
156156
// Reflection would not report custom modifiers at all; this has now changed. But unlike the
@@ -183,7 +183,7 @@ public void ReflectionReturnsCorrectModreqsOnParamTypeForGeneratedType(string ty
183183
var modreqs = this.generatedTypes[typeName].GetMethod("Foo").GetParameters()[0].GetRequiredCustomModifiers();
184184
Assume.That(modreqs.Length > 0); // If this fails on mono/linux we have to revisit the commits and issues for IL method custom modifiers. https://github.com/castleproject/Core/issues/277
185185

186-
CollectionAssert.AreEqual(expected: CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix].Reverse(), actual: modreqs);
186+
CollectionAssert.AreEqual(expected: Enumerable.Reverse(CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix]), actual: modreqs);
187187
// ^ see comment about `.Reverse()` above.
188188
}
189189

@@ -205,7 +205,7 @@ public void ReflectionReturnsCorrectModoptOnReturnTypeForGeneratedType(string ty
205205
var modopts = this.generatedTypes[typeName].GetMethod("Foo").ReturnParameter.GetOptionalCustomModifiers();
206206
Assume.That(modopts.Length > 0); // If this fails on mono/linux we have to revisit the commits and issues for IL method custom modifiers. https://github.com/castleproject/Core/issues/277
207207

208-
CollectionAssert.AreEqual(expected: CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix].Reverse(), actual: modopts);
208+
CollectionAssert.AreEqual(expected: Enumerable.Reverse(CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix]), actual: modopts);
209209
// ^ see comment about `.Reverse()` above.
210210
}
211211

@@ -227,7 +227,7 @@ public void ReflectionReturnsCorrectModreqOnReturnTypeForGeneratedType(string ty
227227
var modreqs = this.generatedTypes[typeName].GetMethod("Foo").ReturnParameter.GetRequiredCustomModifiers();
228228
Assume.That(modreqs.Length > 0); // If this fails on mono/linux we have to revisit the commits and issues for IL method custom modifiers. https://github.com/castleproject/Core/issues/277
229229

230-
CollectionAssert.AreEqual(expected: CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix].Reverse(), actual: modreqs);
230+
CollectionAssert.AreEqual(expected: Enumerable.Reverse(CustomModifiersTestCase.customModifiers[typeNameWithoutSuffix]), actual: modreqs);
231231
// ^ see comment about `.Reverse()` above.
232232
}
233233

src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FieldReference.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public FieldBuilder FieldBuilder
5353

5454
public FieldInfo Reference
5555
{
56-
get { return field; }
56+
get { return @field; }
5757
}
5858

5959
public override void LoadAddressOfReference(ILGenerator gen)

0 commit comments

Comments
 (0)