I apologize for such a long message in advance, but I'm trying for detail here...
I'm working on using bTouch to create a compiled dll for referencing the ArcGIS iOS SDK.
When running bTouch using :
/Developer/MonoTouch/usr/bin/btouch libArcGIS.cs
it returns the following error
/tmp/fp2ivuh8.3gj/IncidentReportApp/AGSMutablePolygon.g.cs(39,31):
error CS0102: The type `IncidentReportApp.AGSMutablePolygon'
already contains a definition for `selAddPointToRing'
/tmp/fp2ivuh8.3gj/IncidentReportApp/AGSMutablePolygon.g.cs(38,31):
(Location of the symbol related to previous error)
/tmp/fp2ivuh8.3gj/IncidentReportApp/AGSMutablePolyline.g.cs(39,31): error CS0102:
The type `IncidentReportApp.AGSMutablePolyline'
already contains a definition for `selAddPointToPath'
/tmp/fp2ivuh8.3gj/IncidentReportApp/AGSMutablePolyline.g.cs(38,31):
(Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
I checked my cs class and neither type is referenced\invoked. I'd like to understand why this message is occuring.
I have tried to use the instructions (and downloaded) code by Al Pascual at How to use the ArcGIS iPhone SDK with MonoTouch to call the Map View, but when attempting to launch the view with the code causes a crash. When I try to debug, it locks up when adding a mapping layer. I tested this with the MKMapView, but didn't experience the same behavior.
The error means that you defined more than one method mapping the same objective-C method.
Without the source, it is hard to diagnose.
I'm doing the same thing actually, I heavily modified the old "parser" library and am working on doing it now, hopefully dropping it in the public domain.
I'm seeing a similar (and probably related) problem in the ApiDefinition, there is a class AGSGPResultLayer that derives from AGSDynamicLayer. The AGSGPResultLayer overrides a property called Credential among other and since both are defining the same property.
How should over-riden properties be handled in bTouch? I'm guessing I'm missing something in the syntax.
Use the solution I provide with the correct bindings
Related
The following gives a runtime error on the last line but why do I not receive a compile time error?
Why is this? fnSub (last line) accepts a type of Sub but here I'm passing it a type of Parent and it compiles. Ok, I do get a runtime error but I'd have thought this should have given me a compile time error. Is this a bug in Dart or am I misunderstanding the limitations of the type system or have I just gone crazy?
class Parent {}
class Sub implements Parent {
String get blah => "blah";
}
String fnSub(Sub sub) => sub.blah;
String aProblem(Parent parent) => fnSub(parent);
https://dartpad.dev/acd2767cd42371deae0644fa66e8c602
The problem is that implicit-casts are enabled by default in Dart which is a feature trying to make it easier to work around types in Dart by automatically adding type casts in your code base.
This feature will no longer be available when NNBD (Non-nullable by default) are coming where implicit-dynamic also will be gone. Both features can already be disabled today by following this guide: https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks
Personally, I think most projects should disable this two features already since I have seen a lot of people on Stackoverflow being confused about what Dart are doing with the types. So I cannot wait for NNBD so we can get are lot more clear type experience in Dart. And hopefully, the errors from the analyzer will be clear enough for most people so they don't need to get help.
If you disable implicit-casts you code will fail at the following line:
String aProblem(Parent parent) => fnSub(parent);
And with this error:
error - The argument type 'Parent' can't be assigned to the parameter type 'Sub'. - bin\stackoverflow.dart:9:41 - argument_type_not_assignable
If you want to test with Dartpad you can try with the following edition based on a beta version of the next Dart version which has enabled null-safety (and therefore have no implicit-casts): https://nullsafety.dartpad.dev/
I've run into an issue with on a branch of FSharp.Data.SqlClient I am working on with the generative SqlEnumProvider type provider. When the test project attemps to use a provided type, I get the following compile-time error:
A problem occurred writing the binary 'C:\code\FSharp.Data.SqlClient\src\SqlClient.Tests\obj\Debug\net451\SqlClient.Tests.dll': Error in pass3 for type FSharp.Data.EnumTests, error: Error in GetMethodRefAsMethodDefIdx for mref = ("Parse", "TinyIntMapping"), error: Exception of type 'Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter+MethodDefNotFound' was thrown.
At design time, everything appears to be working as expected. (I have intellisense on the provided types, etc.)
I attempted the workaround suggested here, but no joy.
How about using the container approach where you place all of the provided types into a container, decanting each one you need?
I used this in quite a few of my type providers, have a look at the iOS designer type provider for reference: https://github.com/xamarin/fsharp-iOS-designer/blob/master/src/Xamarin.iOSProviders/iOSDesignerProvider.fs#L64-L86
It turns out the answer was in the sample template in the SDK, I just wasn't reading it closely enough:
The provider type (e.g., SqlEnumProvider) should be added to the executing assembly.
The root types (e.g., SqlEnumProvider<"SELECT * FROM (VALUES(('One'), 1), ('Two', 2)) AS T(Tag, Value)">) should be added to the provided assembly.
In the failing code, we were adding the root types to both assemblies.
I am trying to migrate some existing code from MVC5 to MVC6 and I am having difficulty with this particular code:
Engine.Razor.RunCompile(File.ReadAllText(emailTemplatePath), "emailTemplateKey", typeof (EmailViewModel), emailViewModel);
I am receiving the following runtime error:
MissingMethodException: Method not found: "Void Microsoft.AspNet.Razor.CodeGenerators.GeneratedClassContext.set_ResolveUrlMethodName(System.String)". in RazorEngine.Compilation.CompilerServiceBase.CreateHost(Type templateType, Type modelType, String className)
The original code I was using in MVC5 was taken from here. If there is no way of converting the above code to work with MVC6 what is another elegant way of doing email templates?
Apparently there has been a change in GeneratedClassContext class - the property ResolveUrlMethodName does not exist anymore, hence the MissingMethodException. Looks like ParserContext class has changed too, since accessing OnError event handler throws the same exception.
In fact it is the setter of the missing property missing (pardon the expression!), which, being a method, causes the exception. Absolutely accurate but somewhat misleading, unless you recall this.
Quite a similar question (and a good answer with alternative solution!) here: RazorEngine and MVC 6 beta 7.
I have experienced the following problem while writing a test. Please find a picture bellow.
If I create validateGameExistance function in the unit test project then it works fine.
How could it be solved?
It is hard to give a definite answer (based just on the screenshot), but you can get this kind of error when some of the types involved in the type error are defined in multiple places (so, the type name would look the same, but they would actually be different types in different assemblies).
For example, if the Result<T> type is defined in multiple projects and the function you're calling returns one of them, but your annotation is referring to another one.
I encountered a strange compiler error in Delphi Prism 2010 that I am unable to resolve. The error is calling a method on an object defined in a third-party assembly that manipulates a specialized image format. The assembly itself was compiled against the .Net 2.0 Runtime.
Despite providing the correct list of parameters, I consistently get an error and series of warning messages indicating the parameter list is incorrect. The VS 2008 IDE also refuses to perform parameter completion, yet correctly shows the method prototype and allows the method to be added using Ctrl-Space. Below is an abbreviated version of the compiler errors to illustrate the problem:
Error 1 (PE19) There is no overloaded method "GetTempMapOfIRSensor" with these parameters
Warning 2 (PH2) Best matching "Image.GetTempMapOfIRSensor(var rectOnSensor: System.Drawing.Rectangle; out average: System.Double; out minTempArrayIndex: System.Int32; out maxTempArrayIndex: System.Int32; desiredTempUnits: Image.TEMP_UNIT): array of System.Double" doesn't match on parameter 1, parameter is "System.Drawing.Rectangle" should be "System.Drawing.Rectangle"
Warning 3 (PH2) Best matching "Image.GetTempMapOfIRSensor(var rectOnSensor: System.Drawing.Rectangle; out average: System.Double; out minTempArrayIndex: System.Int32; out maxTempArrayIndex: System.Int32; desiredTempUnits: Fluke.Thermography.TEMP_UNIT): array of System.Double" doesn't match on parameter 2, parameter is "System.Double" should be "System.Double"
....a list of similar warnings for each remaining parameter
The strange part is that the compiler complains about a type mismatch for each and every parameter, yet the error message shows the parameter type names are the same (e.g. parameter is "System.Double" should be "System.Double").
Any suggestions on how to troubleshoot and resolve this issue would be welcome. The class in question, other than this one method, seems to work fine in every other respect. I am also able to create a method on the local class with the same signature and call it without error.
Update:
Invoking the method using reflection and the same parameter list works properly. This is looking to be a compiler bug/limitation of some sort.
If this library has overloads for non-var/out & var or out parameters with the rest of the signature the same, turn off the option for implicit out/var parameters and add out & var in the places they're needed. That should fix, else a QC entry generally is fixed quite fast, if it's a bug.