When compiling a multi project solution we get this exception from the compiler:
Internal error: System.InvalidCastException: Unable to cast object of type ‘RemObjects.Elements.Code.ExternalTypes.DotNetMethodInfo’ to type ‘RemObjects.Elements.Code.IMutableMethodImplementation’.
at RemObjects.Elements.Code.Compiler.Compiler.CheckIfInterfaceIsImplemented(IParsedType aType, BaseType aInterface, Boolean aIsBase)
at RemObjects.Elements.Code.Compiler.ResolveMembersCompiler.ResolveType__$mapped____(Compiler self, ScopeInfo lScope, IParsedType aType)
at RemObjects.Elements.Code.Compiler.Compiler.ForAllInternalTypes(Action`1 aAt)
at RemObjects.Elements.Code.Compiler.ResolveMembersCompiler.ResolveMembers__$mapped(Compiler self)
Unfortunately there;s very little actionable info here top narrow this doen, leta lone reproduce.fix this . Is there any chance you could share the project with us (privately, and we will of couere keep it confidential and use it only to reproduce the bug?
Yeah thats normal for erros like that. if MSBuild doesnt have a concrete error line, it blames it on the .targets file ;).
Thanx. can you send these invites to mh@remobjects.com? Unfortunately with the messages delivered to talk@, i don’t get timely confirmartion codes to accept the invite…
I have an automatic commit/pull/push script, but the adato_wasm project was not included. All the errors you found are already fixed. Can you pull adato_wasm again and retry?
If you want, we can connect later today or this week to get it going (I’m on CEST).
E: Unknown identifier "ConvertError", did you mean "EConvertError"? [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (321)]
E: Unknown identifier "SFormatTooLong" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (321)]
E: Cannot cast from "<method pointer>" to "EConvertError" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (321)]
E: Unknown identifier "SetString" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (323)]
E: Unknown identifier "FloatToTextFmt" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (323)]
E: Unknown identifier "fvExtended" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (323)]
E: Cannot cast from "String" to "PChar" [/Users/mh/temp/kees/adato_wasm/Wasm/Wasm.System.SysUtils.pas (324)]
it seems i need to deifne DOTNET manually.
with that, ./adato_wasm/Blazor/Delphi/adato_system.elements now compiles. i do get 14 errors, including the/a internal error (doesnt seem to be the same one) and 13 real ones:
E: Internal error: System.InvalidCastException: Specified cast is not valid.
at RemObjects.Elements.Code.Compiler.Compiler.CheckIfInterfaceIsImplemented (RemObjects.Elements.Code.IParsedType aType, RemObjects.Elements.Code.BaseType aInterface, System.Boolean aIsBase) [0x003c6] in <eed51a3d38af4469b1af563ef8695e3c>:0
at RemObjects.Elements.Code.Compiler.ResolveMembersCompiler.ResolveType__$mapped____ (RemObjects.Elements.Code.Compiler.Compiler self, RemObjects.Elements.Code.Compiler.ScopeInfo lScope, RemObjects.Elements.Code.IParsedType aType) [0x00cbf] in <55625d610e6b4f5e9f5f041a35ec54c3>:0
at RemObjects.Elements.Code.Compiler.ResolveMembersCompiler+<>c__DisplayClass17.<ResolveMembers>b__4 (RemObjects.Elements.Code.IParsedType aType) [0x00000] in <55625d610e6b4f5e9f5f041a35ec54c3>:0
at RemObjects.Elements.Code.Compiler.Compiler.ForAllInternalTypes (System.Action`1[T] aAt) [0x00085] in <eed51a3d38af4469b1af563ef8695e3c>:0
at RemObjects.Elements.Code.Compiler.ResolveMembersCompiler.ResolveMembers__$mapped (RemObjects.Elements.Code.Compiler.Compiler self) [0x0031f] in <55625d610e6b4f5e9f5f041a35ec54c3>:0
The IE (a bug, of course) happens in CheckIfInterfaceIsImplemented for
maybe this helps you narrow it down and avoid the error until we fix it. From what i can tell, TComboMultiBox or descendants do implement all three interfaces; the chekc fails for index 0, ie IDCEditControl.
Oddly, notably, this is not the exact same error message as you posted – but thaty could be a Mono vs .NET or a .NET version difference, as the stack seems similar/same
I have updated the project files to use .NET10.0. Still I only get the same error message as before. I do not get the other errors. There is no need to define DOTNET, it should work without.
I have commited and pushed the adato_wasm repo with these changes.
I tried fixing the compilation error by removing interface IDCEditControl from class TComboMultiBox but the same error occurred, probably in another location. For now I’ll await the fix.