0 votes

I used inheritance in my GDscripts, and in my workflow I work with external editor and launch godot from the command line.
When calling a function of the parent class from the child class, if there is a script runtime error, then the error message is not correct.

Here is an example.
parent class:

class_name ParentClass
extends Node

func foo():
    var a = 1
    a/0 # Division By Zero

child class:

extends ParentClass

func _ready():
    foo()

For a scene with just a node with the child class script, in the editor the stack frames are correct:

0 - res://parent_class:7 - at function foo()
1 - res://child_class:4 - at function ready()

but in command line the error message is not (it's the child class file, but the line number in the parent class):

godot scene.tscn 

SCRIPT ERROR: foo: Division By Zero in operator '/'.
   At: res://child_class.gd:7.

I'm using v3.3.rc9.official but AFAIK it was already the case of older versions.

So,
Am I doing something wrong with inheritance?
I haven't found this issue mentioned elsewhere, should I fill a bug report?

Godot version v3.3.rc9.official
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.