Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot extend an Inner Class #65666

Closed
bitwes opened this issue Sep 11, 2022 · 1 comment
Closed

Cannot extend an Inner Class #65666

bitwes opened this issue Sep 11, 2022 · 1 comment

Comments

@bitwes
Copy link

bitwes commented Sep 11, 2022

Godot version

4.0.alpha16.official.86dd3f312

System information

OSX 10.15.7

Issue description

When you attempt to extend an Inner Class it extends the base script instead.

Steps to reproduce

Given:
res://has_inner_classes.gd

class InnerClassA:

    func hello():
        print('world')

res://main.gd

extends SceneTree

var HasInnerClasses = load('res://has_inner_classes.gd')

class ExtendsInnerClassA:
    extends "res://has_inner_classes.gd".InnerClassA

func _init():
    var inst = ExtendsInnerClassA.new()
    if(inst is HasInnerClasses):
        print('instance is a HasInnerClasses')
    if(inst is HasInnerClasses.InnerClassA):
        print('instance is a InnerClassA')

    quit()

Running main.gd in 3.5.stable.official.991bb6ac7 prints:

instance is a InnerClassA

Running main.gd in 4.0.alpha16.official.86dd3f312 prints:

instance is a HasInnerClasses

Minimal reproduction project

Godot4ExtendInnerClass.zip

@Chaosus
Copy link
Member

Chaosus commented Nov 22, 2022

I've tested it, and it seems to be fixed at 11e1c83 (probably by #68374).

@Chaosus Chaosus closed this as completed Nov 22, 2022
Repository owner moved this from Todo to Done in 4.x Priority Issues Nov 22, 2022
Repository owner moved this from Todo to Done in GDScript Stabilization Tasks Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

2 participants