Fix Tokens.Value.toString on unresolved values

It was throwing an exception trying to unwrap unresolved value
This commit is contained in:
Havoc Pennington 2014-05-01 11:13:50 -04:00
parent e5cc23235f
commit 44e8a925b2

View File

@ -26,7 +26,10 @@ final class Tokens {
@Override
public String toString() {
return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")";
if (value().resolveStatus() == ResolveStatus.RESOLVED)
return "'" + value().unwrapped() + "' (" + value.valueType().name() + ")";
else
return "'<unresolved value>' (" + value.valueType().name() + ")";
}
@Override