Skip to content

Commit 5150cf7

Browse files
authored
Merge pull request #150 from Oyami-Srk/haoxuan/fix-imported-file-missing-annotation-error
fix: raise error for missing annotations in imported files
2 parents 0fd8452 + 1a8da28 commit 5150cf7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/src/main/cpp/capnpc-java.c++

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ private:
208208
package = kj::str(annotation.getValue().getText());
209209
}
210210
}
211+
212+
if (package.size() == 0) {
213+
context.exitError(kj::str(node.getDisplayName(), ": no Java package name found. See java.capnp."));
214+
}
215+
if (className.size() == 0) {
216+
context.exitError(kj::str(node.getDisplayName(), ": no Java outer classname found. See java.capnp."));
217+
}
218+
211219
return kj::strTree(kj::mv(package), ".", kj::mv(className));
212220
} else {
213221
Schema parent = schemaLoader.get(node.getScopeId());

0 commit comments

Comments
 (0)