@@ -1440,6 +1440,76 @@ private void TestMethod()
14401440}" ) ;
14411441 }
14421442
1443+ [ Fact ]
1444+ public async Task Issue1148_AddressOfSignatureCompatibilityAsync ( )
1445+ {
1446+ await TestConversionVisualBasicToCSharpAsync ( @"
1447+ Imports System
1448+
1449+ Public Class Issue1148
1450+ Public Shared FuncClass As Func(Of TestObjClass) = AddressOf FunctionReturningClass
1451+ Public Shared FuncBaseClass As Func(Of TestBaseObjClass) = AddressOf FunctionReturningClass
1452+ Public Shared FuncInterface As Func(Of ITestObj) = AddressOf FunctionReturningClass
1453+ Public Shared FuncInterfaceParam As Func(Of ITestObj, ITestObj) = AddressOf CastObj
1454+ Public Shared FuncClassParam As Func(Of TestObjClass, ITestObj) = AddressOf CastObj
1455+
1456+ Public Shared Function FunctionReturningClass() As TestObjClass
1457+ Return New TestObjClass()
1458+ End Function
1459+
1460+ Public Shared Function CastObj(obj As ITestObj) As TestObjClass
1461+ Return CType(obj, TestObjClass)
1462+ End Function
1463+
1464+ End Class
1465+
1466+ Public Class TestObjClass
1467+ Inherits TestBaseObjClass
1468+ Implements ITestObj
1469+ End Class
1470+
1471+ Public Class TestBaseObjClass
1472+ End Class
1473+
1474+ Public Interface ITestObj
1475+ End Interface
1476+ " , @"
1477+ using System;
1478+
1479+ public partial class Issue1148
1480+ {
1481+ public static Func<TestObjClass> FuncClass = FunctionReturningClass;
1482+ public static Func<TestBaseObjClass> FuncBaseClass = FunctionReturningClass;
1483+ public static Func<ITestObj> FuncInterface = FunctionReturningClass;
1484+ public static Func<ITestObj, ITestObj> FuncInterfaceParam = CastObj;
1485+ public static Func<TestObjClass, ITestObj> FuncClassParam = CastObj;
1486+
1487+ public static TestObjClass FunctionReturningClass()
1488+ {
1489+ return new TestObjClass();
1490+ }
1491+
1492+ public static TestObjClass CastObj(ITestObj obj)
1493+ {
1494+ return (TestObjClass)obj;
1495+ }
1496+
1497+ }
1498+
1499+ public partial class TestObjClass : TestBaseObjClass, ITestObj
1500+ {
1501+ }
1502+
1503+ public partial class TestBaseObjClass
1504+ {
1505+ }
1506+
1507+ public partial interface ITestObj
1508+ {
1509+ }
1510+ " ) ;
1511+ }
1512+
14431513 [ Fact ]
14441514 public async Task LambdaImmediatelyExecutedAsync ( )
14451515 {
0 commit comments