Fix error rendering @ConvertProperty annotations during error reporting (#1648)
The added snippet test originally produced error "A value of type `Function2` cannot be exported." This PR actually fixes the bug twice: * By marking `ConvertProperty.render` as `hidden` so that it is skipped when the enclosing object is exported. This broke any attempts to obtain the module schema because this requires exporting all annotations on all class properties. * By changing the way that `VmUndefinedValueException.fillInHint()` obtains the module URI to avoid obtaining the module schema (and triggering the more expensive module schema generation process). It also makes function-typed annotation properties in `pkl:Command` hidden to avoid similar issues there.
This commit is contained in:
1 parent
8b6b90d889
commit
74eae0388e
6 files changed
+64
-6
No files matched your search
@@ -74,7 +74,7 @@ public final class VmUndefinedValueException extends VmEvalException {
|
||||
if (topLevelValue instanceof VmTyped typed && typed.isModuleObject()) {
|
||||
builder
|
||||
.append(" of module `")
|
||||
.append(typed.getModuleInfo().getModuleSchema(typed).getModuleUri())
|
||||
.append(typed.getModuleInfo().getModuleKey().getUri())
|
||||
.append('`');
|
||||
}
|
||||
builder.append('.');
|
||||
|
||||
Reference in new issue
Block a user