Closed rodinaarssen closed 5 years ago
I had a similar error with o.usethesource.vallang.exceptions.UndeclaredAbstractDataTypeException: Tree is not registered (internal error) at $root$(|main://$root$|)
import ParseTree;
in the offending file solved it and exposes the real error: |project://rebel-psac-static/src/psac/Analysis.rsc|(1036,1,<38,20>,<38,21>): Undeclared field: spec for Tree
on a line where I try to access an undefined field indeed.
current suspect: typestore of module B is lacking proper import of module A. The code for ConstructorResult.fieldAccess seems in order.
Module B is fine. It's about the interpreter (or a module C that only imports module B) not having imported module A.
On a sidenote: the type checker also flags this as an error on such a module C.
Right, I wasn't clear. Internally the environment in the interpreter holds an object (a TypeStore) which should import the typestores of other modules. It seems that it doesn't and thus misses the declaration. That's just a guess though. Have to look more into it.
Right. Now I read your comment better. It's because imports aren't transitive. Duh. That's an easy fix to get the right error message on the screen.