-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from MrJul/fix-init-properties
Ignore modopt/modreq on Cecil types to match SRE
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
</Project> | ||
|
||
</Project> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Xunit; | ||
|
||
namespace System.Runtime.CompilerServices | ||
{ | ||
internal static class IsExternalInit | ||
{ | ||
} | ||
} | ||
|
||
namespace XamlParserTests | ||
{ | ||
public class InitPropertiesTestClass | ||
{ | ||
public string Prop1 { get; init; } | ||
public int Prop2 { get; init; } | ||
} | ||
|
||
public class SpecialPropertiesTests : CompilerTestBase | ||
{ | ||
[Fact] | ||
public void Init_Properties_Should_Be_Set() | ||
{ | ||
var result = (InitPropertiesTestClass) CompileAndRun( | ||
"<InitPropertiesTestClass xmlns='clr-namespace:XamlParserTests' Prop1='foo' Prop2='42' />"); | ||
Assert.Equal("foo", result.Prop1); | ||
Assert.Equal(42, result.Prop2); | ||
} | ||
} | ||
} |