Use empty string as default value for string annotation values

This commit is contained in:
Tony Torralba
2022-04-19 17:57:44 +02:00
parent 8a3ed6bdcf
commit 66e6f4d25e

View File

@@ -418,7 +418,9 @@ private string stubAnnotationSimpleValue(Expr value) {
value instanceof Literal or
value instanceof CompileTimeConstantExpr
) and
result = stubDefaultValue(value.getType())
if value instanceof StringLiteral
then result = "\"\""
else result = stubDefaultValue(value.getType())
or
// We can't use stubAnnotation here because it causes a non-monotonic recursion.
// Handling the most basic case of a nested annotation for now.