You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@instanceOf class with a relative @module is imported relative to the module that matches on it #9520
An @instanceOf type can name its class with a @module path relative to its own file (#9309). When an untagged variant with that type as a case is matched in a module of another directory, the generated import is the same relative string, so it points at a file beside the module with the match, not beside the module that declares the type.
Tested on master at e2318f2, built from source. The feature is not in a release yet.
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../src/app/shapes.js' imported from .../src/app/App.mjs
If a src/app/shapes.js exists, that is the file the import names, so the check would use whatever it exports as Circle.
Expected: import * as ShapesJs from "../shapes/shapes.js";, and for a type declared in a dependency package, a path into that package. Package specifiers such as "three" and global classes are fine. The existing test (untagged_module_class_test.res) keeps everything in one directory, so it does not see this.
Externals with a relative path avoid the same problem because they are called through the declaring module. A type has no value to go through, so the path needs to be rewritten for the module that compiles the check.
Activity