There seems to be a bug in the pdc compiler when importing scripts into tables. If you import a script into a table value and another string in the lua source comes after a valid import, it'll try to find a script with that string's value and fail to build if it doesn't exist. This may be reproducible without tables, but this is the only way I've experienced it so far.
It's reproducible with a very simple project.
main.lua:
script = {
{
name = "intro",
sequence = import "scripts/intro"
},
{
name = "anyValue",
sequence = import "scripts/ending"
}
}
scripts/intro.lua, etc.:
return {{
text = "Example value of some type"
}}
When building with pdc or a build task like the Nova extension:
error: main.lua:7: No such file: anyValue
Things I've observed:
- Renaming keys has no effect
- Adding explicit keys to the top-level table has no effect
- An invalid value on the actual
importcall will trigger a compile error as it should, preventing the invalid compile error from being raised - Changing the
anyValuevalue to a valid script path will not fail to compile but may be doing something weird with where the imported value ends up in the table (unconfirmed) - Removing the
namekey builds correctly with the imported values being set in the table - The compiler always reports an error on the last
namekey if all actualimportcalls are valid
This doesn't seem like a naming collision, as any of the string values here can be changed arbitrarily and the result is the same, but I'm not sure what else could cause this outside of a compiler bug.