Bug 18365 - "Overrode method which isn't an interface method?!" message for explicitly implemented interfaces
Summary: "Overrode method which isn't an interface method?!" message for explicitly im...
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.6.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-03-13 14:21 UTC by Joe Friedrichsen
Modified: 2014-03-17 13:16 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Build this and see the warning print (11.18 KB, application/zip)
2014-03-13 14:21 UTC, Joe Friedrichsen
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Joe Friedrichsen 2014-03-13 14:21:10 UTC
Created attachment 6304 [details]
Build this and see the warning print

Given a class that inherits from both IUIDocumentInteractionControllerDelegate and another simple interface, when that class explicitly implements the simple interface, the compiler prints this message:

Overrode method which isn't an interface method?!

See the attached project for an example.
* The simple interface is ITest.cs
* The warnings are generated from Warnings.cs. Publicly implement ITest to silence them.
* The NoWarnings.cs file has the same parentage as Warnings.cs, but publicly implements ITest.
* The NoWarningsToo.cs file shows that the parents of IUIDocumentInteractionControllerDelegate (INativeObject, IDisposable) do not prompt the warnings.

It appears that the ProtocolAttribute might be the start of the trail.

Here is the build output:

$ /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build -p:OverrideBugTest -t:Build -c:'Debug|iPhone' OverrideBugTest.sln 
MonoDevelop Build Tool
INFO:Found Xcode, version 5.0.2 (3335.32).
INFO:Found Xamarin.iOS, version 7.0.6.167.
Loading solution: /Users/test/Desktop/OverrideBugTest/OverrideBugTest.sln
   Loading solution: /Users/test/Desktop/OverrideBugTest/OverrideBugTest.sln
      Loading projects ..
   Building: OverrideBugTest (Debug|iPhone)
      Detecting signing identity...
         Provisioning Profile: "Redacted" (redacted)
         Signing Identity: "Redacted"
         App ID: "redacted.com.your-company.OverrideBugTest"
      Performing main compilation...
      /Library/Frameworks/Mono.framework/Versions/3.2.6/bin/mcs /noconfig "/r:/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll" -nostdlib "/out:/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.exe"
      "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
      "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG;__MOBILE__;__IOS__"  /t:exe "/Users/test/Desktop/OverrideBugTest/Main.cs"
      "/Users/test/Desktop/OverrideBugTest/AppDelegate.cs" "/Users/test/Desktop/OverrideBugTest/OverrideBugTestViewController.cs" "/Users/test/Desktop/OverrideBugTest/OverrideBugTestViewController.designer.cs"
      "/Users/test/Desktop/OverrideBugTest/ITest.cs" "/Users/test/Desktop/OverrideBugTest/Warnings.cs" "/Users/test/Desktop/OverrideBugTest/NoWarnings.cs" 
      Build complete -- 0 errors, 0 warnings
      Compiling to native code
         /Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/test/Desktop/OverrideBugTest/obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign -dev
         "/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r
         "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -debug -linksdkonly -sdk "7.0" -targetver "7.0" --abi=armv7
         "/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.exe"
         Xamarin.iOS 7.0.6 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
         Overrode method which isn't an interface method?!
         OverrideBugTest.app built successfully.
      Updating debug configuration file
      Updating debug settings manifest
      Embedding provisioning profile
      Processing entitlements file
      Preparing resources rules
      Signing application
         codesign -v -f -s "Redacted" "--resource-rules=/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.app/ResourceRules.plist" --entitlements
         "/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.xcent" "/Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.app"
         /Users/test/Desktop/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.app: signed bundle with Mach-O thin (armv7) [com.your-company.OverrideBugTest]
Comment 1 Sebastien Pouliot 2014-03-13 16:08:21 UTC
From your log is seems this comes from `mtouch`.

Using the provided solution (as is) I cannot duplicate (or find that string) in the most recent (internal) builds.


Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode51.app/Contents/Developer" --cache "/Users/sebastienpouliot/Downloads/OverrideBugTest/obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign -dev "/Users/sebastienpouliot/Downloads/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -debug -linksdkonly -sdk "7.1" -targetver "7.0" --abi=armv7 "/Users/sebastienpouliot/Downloads/OverrideBugTest/bin/iPhone/Debug/OverrideBugTest.exe"
Xamarin.iOS 7.2.1 Business Edition using framework: /Applications/Xcode51.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk
OverrideBugTest.app built successfully.