sorear / niecza

A Perl 6 compiler targetting the CLR with an experimental focus on optimizations.
Artistic License 2.0
153 stars 15 forks source link

System.Reflection.TargetException gtk-clock under .Net #59

Open diakopter opened 13 years ago

diakopter commented 13 years ago

under cmd.exe (and cygwin also, separately; both produce the same error) under .Net: C:\Users\mwilson\src\niecza>run\Niecza.exe examples\gtk-clock.pl Unhandled exception: System.Reflection.TargetException: Non-static method requir es a target. at System.Reflection.RuntimeConstructorInfo.CheckConsistency(Object target) at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags i nvokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Niecza.OverloadCandidate.Invoke(Object obj, Variable[] pos, VarHash named)

at Niecza.CLRWrapperProvider.cAnonStoreyA.<>mB(Frame th) at Niecza.Kernel.RunCore(Frame& cur) at line 0 (CLR::Gtk::Window.new @ 0) at C:\Users\mwilson\src\niecza\examples\gtk-clock.pl line 17 (MAIN mainline @ 2) at C:\Users\mwilson\src\niecza\lib\CORE.setting line 2115 (CORE C1022_ANON @ 2 ) at C:\Users\mwilson\src\niecza\lib\CORE.setting line 2116 (CORE module-CORE @ 58) at C:\Users\mwilson\src\niecza\lib\CORE.setting line 2116 (CORE mainline @ 1)

at line 0 (boot-MAIN @ 1) at line 0 (ExitRunloop @ 0) at C:\Users\mwilson\src\niecza\boot\lib\CORE.setting line 685 (CORE die @ 2) at C:\Users\mwilson\src\niecza\src\NieczaBackendDotnet.pm6 line 37 (NieczaBack endDotnet NieczaBackendDotnet.accept @ 13) at C:\Users\mwilson\src\niecza\src\NieczaCompiler.pm6 line 32 (NieczaCompiler C19_ANON @ 4) at C:\Users\mwilson\src\niecza\src\NieczaCompiler.pm6 line 38 (NieczaCompiler NieczaCompiler.compile @ 18) at C:\Users\mwilson\src\niecza\src\NieczaCompiler.pm6 line 68 (NieczaCompiler NieczaCompiler.compile_file @ 5) at C:\Users\mwilson\src\niecza\src\niecza line 306 (MAIN mainline @ 107) at C:\Users\mwilson\src\niecza\boot\lib\CORE.setting line 1933 (CORE C906_ANON @ 2) at C:\Users\mwilson\src\niecza\boot\lib\CORE.setting line 1934 (CORE module-CO RE @ 56) at C:\Users\mwilson\src\niecza\boot\lib\CORE.setting line 1934 (CORE mainline @ 1) at line 0 (boot-MAIN @ 1) at line 0 (ExitRunloop @ 0)

samlh commented 12 years ago

gtk-clock.pl and gtk-sierpinski.pl work for me if $cc.Target.Dispose; is commented out (line 50, line 47 resp.). gtk-tetris.pl works as is. Otherwise I get an error about being unable to find Dispose in CLR::Cairo::Surface. Full backtace below:

Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Unable to resolve method Dispose in class CLR::Cairo::Surface at C:\Users\1880337\Documents\gtk-clock.pl line 50 (ANON @ 40) at line 0 (ExitRunloop @ 0) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Delegate.DynamicInvokeImpl(Object[] args) at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args) at GLib.SignalClosure.Invoke(ClosureInvokedArgs args) at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) at GLib.ExceptionManager.RaiseUnhandledException(Exception e, Boolean is_terminal) at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) at Gtk.Application.gtk_main() at Gtk.Application.Run() at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Niecza.OverloadCandidate.Invoke(Frame th, Variable[] pos, VarHash named) at Niecza.CandidateSet.DoDispatch(Frame th, Variable[] pos, VarHash named, P6any junc_call) at Niecza.CLRWrapperProvider.Binder(Frame th) at Niecza.Kernel.RunCore(Frame& cur) at Niecza.Kernel.RunInferior(Frame f) at Niecza.RuntimeUnit.RunMainline() at Niecza.Kernel.RunMain(RuntimeUnit main_unit) at Niecza.CLRBackend.DowncallReceiver.run_unit(Object[] args) at Niecza.CLRBackend.DowncallReceiver.Call(Object[] args) at Niecza.CLRBackend.DowncallReceiver.get_Item(Object i) at Niecza.Downcaller.DownCall(Variable list) at Niecza.C2542downcall(Frame ) at Niecza.Kernel.RunCore(Frame& cur) at Niecza.Kernel.RunInferior(Frame f) at Niecza.RuntimeUnit.RunMainline() at Niecza.Kernel.RunMain(RuntimeUnit main_unit) at Niecza.Kernel.MainHandler(String uname, String[] args) at Niecza.Main(String[] )

Cairo.Context: called from finalization thread, programmer is missing a call to Dispose