Skip to content

Commit 42d9c05

Browse files
committed
Fix serialize
> Sentry.Bindings.Cocoa net8.0-maccatalyst17.0 failed with 1 error(s) and 1 warning(s) (2.7s) > ApiDefinitions.cs(937,38): warning CS0108: 'SentrySpan.Serialize()' hides inherited member 'SentrySerializable.Serialize()'. Use the new keyword if hiding was intended. > /Users/jpnurmi/Projects/sentry/sentry-dotnet/src/Sentry.Bindings.Cocoa/obj/Release/net8.0-maccatalyst17.0/MacCatalyst/Sentry.CocoaSdk/SentrySpan.g.cs(134,36): error CS0108: 'ISentrySpan.Serialize()' hides inherited member 'ISentrySerializable.Serialize()'. Use the new keyword if hiding was intended.
1 parent 997d96c commit 42d9c05

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/generate-cocoa-bindings.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ $Text = $Text -replace '([\[,] )iOS \(', '$1Introduced (PlatformName.iOS, '
279279
$Text = $Text -replace '(?m)^interface SentryScope', 'partial $&'
280280

281281
# Prefix SentryBreadcrumb.Serialize and SentryScope.Serialize with new (since these hide the base method)
282-
$Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*\[Export \("serialize"\)\]$\s*)(NSDictionary)', '${1}new $2'
282+
$Text = $Text -replace '(?m)(^\s*\/\/[^\r\n]*$\s*(?:\[Abstract\]\s*)?\[Export \("serialize"\)\]$\s*)(NSDictionary)', '${1}new $2'
283283

284284
$Text = $Text -replace '.*SentryEnvelope .*?[\s\S]*?\n\n', ''
285285
$Text = $Text -replace '.*typedef.*SentryOnAppStartMeasurementAvailable.*?[\s\S]*?\n\n', ''

src/Sentry.Bindings.Cocoa/ApiDefinitions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ interface SentrySerializable
183183
// @required -(NSDictionary<NSString *,id> * _Nonnull)serialize;
184184
[Abstract]
185185
[Export ("serialize")]
186-
NSDictionary<NSString, NSObject> Serialize();
186+
new NSDictionary<NSString, NSObject> Serialize();
187187
}
188188

189189
// @interface SentryBreadcrumb : NSObject <SentrySerializable>
@@ -930,6 +930,11 @@ interface SentrySpan : SentrySerializable
930930
[Abstract]
931931
[NullAllowed, Export ("baggageHttpHeader")]
932932
string BaggageHttpHeader { get; }
933+
934+
// @required -(NSDictionary<NSString *,id> * _Nonnull)serialize;
935+
[Abstract]
936+
[Export ("serialize")]
937+
new NSDictionary<NSString, NSObject> Serialize();
933938
}
934939

935940
// @interface SentryHub : NSObject

0 commit comments

Comments
 (0)