Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

[SoM] ObjC inheritance generates method hiding warnings #47

Open
stephen-hawley opened this issue Jun 19, 2019 · 0 comments
Open

[SoM] ObjC inheritance generates method hiding warnings #47

stephen-hawley opened this issue Jun 19, 2019 · 0 comments
Assignees
Milestone

Comments

@stephen-hawley
Copy link
Contributor

		[Test]
		public void TestCtorJumpInherit ()
		{
			var swiftCode = @"
import Foundation
@objc
open class ImAnNSObject : NSObject {
    public init (nibName: Int, bundle: Int)
    {
        
    }
}

open class MyInheritor : ImAnNSObject {
    public func getValue () -> Int {
        return 17
    }
}
";
			var declID = new CSIdentifier ("cl");
			var decl = CSVariableDeclaration.VarLine (CSSimpleType.Var, declID, new CSFunctionCall ("MyInheritor", true, CSConstant.Val (7), CSConstant.Val (8)));
			var printer = CSFunctionCall.ConsoleWriteLine (new CSFunctionCall ($"{declID.Name}.GetValue", false));
			var callingCode = CSCodeBlock.Create (decl, printer);

			TestRunning.TestAndExecute (swiftCode, callingCode, "17\n", platform: PlatformName.macOS);
		}
	}

The issue appears to be that when the ObjC object is also bound by SoM, it will already have the members in it and we have no idea that we've already bound it and we get a name conflict warning.

Detecting this case is the trick - I can easily detect it when it's within the same module, but if the type came in from an external module that SoM already did the binding for, we can't tell that we had done the binding.

@stephen-hawley stephen-hawley self-assigned this Jun 19, 2019
@stephen-hawley stephen-hawley transferred this issue from another repository Oct 29, 2019
@chamons chamons added this to the Future milestone Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants