Skip to content

Commit

Permalink
Merge pull request #11363 from AvaloniaUI/fix-unnecessary-corelib-ref…
Browse files Browse the repository at this point in the history
…erence

Use TypeSystem.String instead of typeof(string) when resolving types from Cecil
  • Loading branch information
maxkatz6 authored May 14, 2023
2 parents 4485356 + f858a7a commit 515391f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ MessageImportance logImportance
{
var ctor = asm.MainModule.ImportReference(typeSystem.GetTypeReference(asmMetadata).Resolve()
.GetConstructors().First(c => c.Parameters.Count == 2).Resolve());
var strType = asm.MainModule.ImportReference(typeof(string));
var strType = asm.MainModule.TypeSystem.String;
var arg1 = new CustomAttributeArgument(strType, "AvaloniaUseCompiledBindingsByDefault");
var arg2 = new CustomAttributeArgument(strType, defaultCompileBindings.ToString());
asm.CustomAttributes.Add(new CustomAttribute(ctor) { ConstructorArguments = { arg1, arg2 } });
Expand Down

0 comments on commit 515391f

Please sign in to comment.