Skip to content

Type trees compiled out of order can have bogus <init> procs #2630

@tontyGH

Description

@tontyGH

Broken code block in question:

/obj
  var/list/type_list = null

/obj/subtype/broken
  type_list = null

/obj/subtype
  type_list = list(/datum, /atom, /obj,)

/proc/main()
  var/obj/O = new /obj/subtype/broken()
  world.log << isnull(O.type_list)

When /obj/subtype/broken has to build its init vars, it correctly identifies that type_list is a null constant and checks the parent to see if it should still override its proc. However, because it's being built before its parent type was ready, it will see that /obj/subtype has no init vars and simply assume that it doesn't need to make one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CompilerInvolves the OpenDream compiler

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions