Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13775,7 +13775,7 @@ partial interface NSHost {
NSHost _FromAddress (string address);

[Export ("isEqualToHost:")]
bool Equals (NSHost host);
bool Equals ([NullAllowed] NSHost host);

[Export ("name")]
string Name { get; }
Expand Down
22 changes: 22 additions & 0 deletions tests/monotouch-test/Foundation/NSHostTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#if __MACOS__
using System;
using System.Collections;
using System.Collections.Generic;

using NUnit.Framework;

using Foundation;

#nullable enable

namespace MonoTouchFixtures.Foundation {
public class NSHostTest {

public void EqualsNullAllowed ()
{
using var host = NSHost.FromAddress ("http://microsoft.com");
Assert.False (host.Equals (null));
}
}
}
#endif
3 changes: 3 additions & 0 deletions tests/xtro-sharpie/macOS-Foundation.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -834,3 +834,6 @@
!missing-null-allowed! 'System.Void Foundation.NSUserNotification::set_Subtitle(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void Foundation.NSUserNotification::set_Title(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void Foundation.NSUserNotification::set_UserInfo(Foundation.NSDictionary)' is missing an [NullAllowed] on parameter #0

# added because the method does the right thing yet it was not marked by apple, there is a test for it
!extra-null-allowed! 'System.Boolean Foundation.NSHost::Equals(Foundation.NSHost)' has a extraneous [NullAllowed] on parameter #0