Closed spongeboburu closed 5 years ago
CC @karroffel
In theory you can issue an error, it's not exposed to NativeScript yet AFAIK.
The problem here is in the C++ bindings, which don't do any validation of arguments yet. Other bindings such as the Rust bindings already do it, so this is not a GDNative/NativeScript problem but a library side validation problem.
There already is an issue about that and it shouldn't be too hard to actually implement it, but nobody got around to doing it yet. (Zylann did at one point, but the bindings moved on from then)
@karroffel
Should we mark this as a duplicate with the issue you are referring to and close this one?
There already is an issue about that and it shouldn't be too hard to actually implement it, but nobody got around to doing it yet.
I guess @karroffel meant GodotNativeTools/godot-cpp#209, so closing as a dulicate.
Godot version: 3.1 master
OS/device including version: Fedora 28, 64-bit
Issue description: If I call a gdnative plugin from gdscript and the C++ signature has arguments, but none are specified in the calling gdscript then the scene crashes and the editor dumps a backtrace:
Im thinking the expected behavior is to show an error about the minimum required arguments.
Also as a side note there is no upper limit check either. So in C++ (int arg1, int arg2) and gdscript its a valid call to do myunc(1,2,3,4,5,6,7,8,9) and so on.
Although it is my first time trying gdnative and my C++ is not very good, so there might be something obvious I missed.
Steps to reproduce: C++ signature for your gdtype subclass:
Try to call it from gdscript: