Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hr): Add dummy class at the end of the generated file #19436

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,26 @@ private SourceText InnerGenerateFile()
BuildXBindTryGetDeclarations(writer);
}
}

if (_isHotReloadEnabled && Generation.IOSViewSymbol.Value is not null)
{
// Workaround for HR behaving incorrectly on iOS
// https://github.com/xamarin/xamarin-macios/issues/22102

using (writer.BlockInvariant($"namespace __internal"))
{
writer.AppendLineIndented("/// <remarks>Internal Use for iOS only.</remarks>");
writer.AppendLineIndented("[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]");
writer.AppendLineIndented("[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]");
using (writer.BlockInvariant($"static partial class __{_xClassName.ClassName}_Dummy"))
{
using (writer.BlockInvariant("private static class Dummy_Bindings"))
{
writer.AppendLineIndented("private static object Owner { get; set; }");
}
}
}
}
}
}

Expand Down
Loading