Skip to content

Commit 7ae80d3

Browse files
mandel-macaqueGitHub Actions Autoformatter
andauthored
[RGen] Use the global alias for the Runtime class. (#22615)
This way we will minimize the chances of having collisions with user code. --------- Co-authored-by: GitHub Actions Autoformatter <[email protected]>
1 parent 493f4e5 commit 7ae80d3

File tree

8 files changed

+50
-47
lines changed

8 files changed

+50
-47
lines changed

src/rgen/Microsoft.Macios.Generator/Emitters/BindingSyntaxFactory.Runtime.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
namespace Microsoft.Macios.Generator.Emitters;
1313

1414
static partial class BindingSyntaxFactory {
15-
public static readonly ExpressionSyntax Runtime = GetIdentifierName ("Runtime");
15+
public static readonly ExpressionSyntax Runtime = GetIdentifierName (
16+
@namespace: ["ObjCRuntime"],
17+
@class: "Runtime",
18+
isGlobal: true);
1619
public static readonly ExpressionSyntax CFString = GetIdentifierName (
1720
@namespace: ["CoreFoundation"],
1821
@class: "CFString",

tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/iOSExpectedPropertyTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public static partial Foundation.NSCharacterSet Alphanumerics
221221
{
222222
Foundation.NSCharacterSet ret;
223223
if (IsDirectBinding) {
224-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
224+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
225225
} else {
226-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
226+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
227227
}
228228
GC.KeepAlive (this);
229229
return ret;
@@ -245,9 +245,9 @@ public virtual partial Foundation.NSAttributedString AttributedStringByInflectin
245245
{
246246
Foundation.NSAttributedString ret;
247247
if (IsDirectBinding) {
248-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
248+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
249249
} else {
250-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
250+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
251251
}
252252
GC.KeepAlive (this);
253253
return ret;
@@ -482,9 +482,9 @@ internal virtual partial Foundation.NSLocale Locale
482482
{
483483
Foundation.NSLocale ret;
484484
if (IsDirectBinding) {
485-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
485+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
486486
} else {
487-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
487+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
488488
}
489489
GC.KeepAlive (this);
490490
return ret;
@@ -752,9 +752,9 @@ public virtual partial Foundation.NSObject? WeakDelegate
752752
{
753753
Foundation.NSObject? ret;
754754
if (IsDirectBinding) {
755-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
755+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
756756
} else {
757-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
757+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
758758
}
759759
GC.KeepAlive (this);
760760
return ret;

tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/macOSExpectedPropertyTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public static partial Foundation.NSCharacterSet Alphanumerics
221221
{
222222
Foundation.NSCharacterSet ret;
223223
if (IsDirectBinding) {
224-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
224+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
225225
} else {
226-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
226+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
227227
}
228228
GC.KeepAlive (this);
229229
return ret;
@@ -245,9 +245,9 @@ public virtual partial Foundation.NSAttributedString AttributedStringByInflectin
245245
{
246246
Foundation.NSAttributedString ret;
247247
if (IsDirectBinding) {
248-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
248+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
249249
} else {
250-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
250+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
251251
}
252252
GC.KeepAlive (this);
253253
return ret;
@@ -482,9 +482,9 @@ internal virtual partial Foundation.NSLocale Locale
482482
{
483483
Foundation.NSLocale ret;
484484
if (IsDirectBinding) {
485-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
485+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
486486
} else {
487-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
487+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
488488
}
489489
GC.KeepAlive (this);
490490
return ret;
@@ -752,9 +752,9 @@ public virtual partial Foundation.NSObject? WeakDelegate
752752
{
753753
Foundation.NSObject? ret;
754754
if (IsDirectBinding) {
755-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
755+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
756756
} else {
757-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
757+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
758758
}
759759
GC.KeepAlive (this);
760760
return ret;

tests/rgen/Microsoft.Macios.Generator.Tests/Classes/Data/tvOSExpectedPropertyTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public static partial Foundation.NSCharacterSet Alphanumerics
221221
{
222222
Foundation.NSCharacterSet ret;
223223
if (IsDirectBinding) {
224-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
224+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
225225
} else {
226-
ret = Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
226+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSCharacterSet> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("alphanumericCharacterSet")))!;
227227
}
228228
GC.KeepAlive (this);
229229
return ret;
@@ -245,9 +245,9 @@ public virtual partial Foundation.NSAttributedString AttributedStringByInflectin
245245
{
246246
Foundation.NSAttributedString ret;
247247
if (IsDirectBinding) {
248-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
248+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
249249
} else {
250-
ret = Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
250+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSAttributedString> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("attributedStringByInflectingString")))!;
251251
}
252252
GC.KeepAlive (this);
253253
return ret;
@@ -482,9 +482,9 @@ internal virtual partial Foundation.NSLocale Locale
482482
{
483483
Foundation.NSLocale ret;
484484
if (IsDirectBinding) {
485-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
485+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("locale")))!;
486486
} else {
487-
ret = Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
487+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSLocale> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("locale")))!;
488488
}
489489
GC.KeepAlive (this);
490490
return ret;
@@ -752,9 +752,9 @@ public virtual partial Foundation.NSObject? WeakDelegate
752752
{
753753
Foundation.NSObject? ret;
754754
if (IsDirectBinding) {
755-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
755+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle ("delegate")));
756756
} else {
757-
ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
757+
ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle ("delegate")));
758758
}
759759
GC.KeepAlive (this);
760760
return ret;

tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/BindingSyntaxFactoryFieldAccessorsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public partial class CGColorSpaceNames {
519519
";
520520

521521
yield return [nsArrayFieldProperty,
522-
"Runtime.GetNSObject<Foundation.NSArray> (global::ObjCRuntime.Dlfcn.GetIndirect (Libraries.CoreGraphics.Handle, \"kCGColorSpaceGenericGray\"))!"];
522+
"global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSArray> (global::ObjCRuntime.Dlfcn.GetIndirect (Libraries.CoreGraphics.Handle, \"kCGColorSpaceGenericGray\"))!"];
523523

524524
const string nsNumberFieldProperty = @"
525525
using System;
@@ -540,7 +540,7 @@ public partial class CGColorSpaceNames {
540540
";
541541

542542
yield return [nsNumberFieldProperty,
543-
"Runtime.GetNSObject<Foundation.NSNumber> (global::ObjCRuntime.Dlfcn.GetIndirect (Libraries.CoreGraphics.Handle, \"kCGColorSpaceGenericGray\"))!"];
543+
"global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSNumber> (global::ObjCRuntime.Dlfcn.GetIndirect (Libraries.CoreGraphics.Handle, \"kCGColorSpaceGenericGray\"))!"];
544544

545545
const string sbyteEnumFieldProperty = @"
546546
using System;

tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/BindingSyntaxFactoryPropertyTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ public IEnumerator<object []> GetEnumerator ()
215215

216216
yield return [
217217
property,
218-
"ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle (\"myProperty\")))!",
219-
"ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle (\"myProperty\")))!"
218+
"ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle (\"myProperty\")))!",
219+
"ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle (\"myProperty\")))!"
220220
];
221221

222222
property = new Property (
@@ -240,8 +240,8 @@ public IEnumerator<object []> GetEnumerator ()
240240

241241
yield return [
242242
property,
243-
"ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle (\"myProperty\")))",
244-
"ret = Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle (\"myProperty\")))"
243+
"ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSend (this.Handle, Selector.GetHandle (\"myProperty\")))",
244+
"ret = global::ObjCRuntime.Runtime.GetNSObject<Foundation.NSObject> (global::ObjCRuntime.Messaging.NativeHandle_objc_msgSendSuper (this.Handle, Selector.GetHandle (\"myProperty\")))"
245245
];
246246

247247
property = new Property (

tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/BindingSyntaxFactoryRuntimeTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,15 @@ public IEnumerator<object []> GetEnumerator ()
573573
ImmutableArray.Create (
574574
Argument (IdentifierName ("arg1"))),
575575
false,
576-
"Runtime.GetNSObject<NSString> (arg1)"
576+
"global::ObjCRuntime.Runtime.GetNSObject<NSString> (arg1)"
577577
];
578578

579579
yield return [
580580
"NSString",
581581
ImmutableArray.Create (
582582
Argument (IdentifierName ("arg1"))),
583583
true,
584-
"Runtime.GetNSObject<NSString> (arg1)!"
584+
"global::ObjCRuntime.Runtime.GetNSObject<NSString> (arg1)!"
585585
];
586586

587587
yield return [
@@ -592,7 +592,7 @@ public IEnumerator<object []> GetEnumerator ()
592592
Argument (IdentifierName ("arg3"))
593593
),
594594
false,
595-
"Runtime.GetNSObject<NSNumber> (arg1, arg2, arg3)"
595+
"global::ObjCRuntime.Runtime.GetNSObject<NSNumber> (arg1, arg2, arg3)"
596596
];
597597

598598
yield return [
@@ -603,7 +603,7 @@ public IEnumerator<object []> GetEnumerator ()
603603
Argument (IdentifierName ("arg3"))
604604
),
605605
true,
606-
"Runtime.GetNSObject<NSNumber> (arg1, arg2, arg3)!"
606+
"global::ObjCRuntime.Runtime.GetNSObject<NSNumber> (arg1, arg2, arg3)!"
607607
];
608608
}
609609

@@ -626,15 +626,15 @@ public IEnumerator<object []> GetEnumerator ()
626626
ImmutableArray.Create (
627627
Argument (IdentifierName ("arg1"))),
628628
false,
629-
"Runtime.GetINativeObject<NSString> (arg1)"
629+
"global::ObjCRuntime.Runtime.GetINativeObject<NSString> (arg1)"
630630
];
631631

632632
yield return [
633633
"NSString",
634634
ImmutableArray.Create (
635635
Argument (IdentifierName ("arg1"))),
636636
true,
637-
"Runtime.GetINativeObject<NSString> (arg1)!"
637+
"global::ObjCRuntime.Runtime.GetINativeObject<NSString> (arg1)!"
638638
];
639639

640640
yield return [
@@ -645,7 +645,7 @@ public IEnumerator<object []> GetEnumerator ()
645645
Argument (IdentifierName ("arg3"))
646646
),
647647
false,
648-
"Runtime.GetINativeObject<NSNumber> (arg1, arg2, arg3)"
648+
"global::ObjCRuntime.Runtime.GetINativeObject<NSNumber> (arg1, arg2, arg3)"
649649
];
650650

651651
yield return [
@@ -656,7 +656,7 @@ public IEnumerator<object []> GetEnumerator ()
656656
Argument (IdentifierName ("arg3"))
657657
),
658658
true,
659-
"Runtime.GetINativeObject<NSNumber> (arg1, arg2, arg3)!"
659+
"global::ObjCRuntime.Runtime.GetINativeObject<NSNumber> (arg1, arg2, arg3)!"
660660
];
661661
}
662662

@@ -712,7 +712,7 @@ public IEnumerator<object []> GetEnumerator ()
712712
yield return [
713713
ImmutableArray.Create (
714714
Argument (IdentifierName ("arg1"))),
715-
"Runtime.RetainAndAutoreleaseNSObject (arg1)",
715+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (arg1)",
716716
];
717717

718718
yield return [
@@ -721,7 +721,7 @@ public IEnumerator<object []> GetEnumerator ()
721721
Argument (IdentifierName ("arg2")),
722722
Argument (IdentifierName ("arg3"))
723723
),
724-
"Runtime.RetainAndAutoreleaseNSObject (arg1, arg2, arg3)",
724+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (arg1, arg2, arg3)",
725725
];
726726
}
727727

@@ -742,7 +742,7 @@ public IEnumerator<object []> GetEnumerator ()
742742
yield return [
743743
ImmutableArray.Create (
744744
Argument (IdentifierName ("arg1"))),
745-
"Runtime.RetainAndAutoreleaseNativeObject (arg1)",
745+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNativeObject (arg1)",
746746
];
747747

748748
yield return [
@@ -751,7 +751,7 @@ public IEnumerator<object []> GetEnumerator ()
751751
Argument (IdentifierName ("arg2")),
752752
Argument (IdentifierName ("arg3"))
753753
),
754-
"Runtime.RetainAndAutoreleaseNativeObject (arg1, arg2, arg3)",
754+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNativeObject (arg1, arg2, arg3)",
755755
];
756756
}
757757

tests/rgen/Microsoft.Macios.Generator.Tests/Emitters/BindingSyntaxFactoryTrampolineTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void MyMethod (Callback cb) {}
3333

3434
yield return [
3535
arrayNSObjectResult,
36-
"Runtime.RetainAndAutoreleaseNSObject (NSArray.FromNSObjects (auxVariable))"
36+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (NSArray.FromNSObjects (auxVariable))"
3737
];
3838

3939
const string nsObjectResult = @"
@@ -51,7 +51,7 @@ public void MyMethod (Callback cb) {}
5151

5252
yield return [
5353
nsObjectResult,
54-
"Runtime.RetainAndAutoreleaseNSObject (auxVariable)"
54+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (auxVariable)"
5555
];
5656

5757
const string nativeObjectResult = @"
@@ -70,7 +70,7 @@ public void MyMethod (Callback cb) {}
7070

7171
yield return [
7272
nativeObjectResult,
73-
"Runtime.RetainAndAutoreleaseNativeObject (auxVariable)"
73+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNativeObject (auxVariable)"
7474
];
7575

7676
const string protocolResult = @"
@@ -89,7 +89,7 @@ public void MyMethod (Callback cb) {}
8989

9090
yield return [
9191
protocolResult,
92-
"Runtime.RetainAndAutoreleaseNSObject (auxVariable)"
92+
"global::ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (auxVariable)"
9393
];
9494

9595
const string systemStringResult = @"

0 commit comments

Comments
 (0)