Added prohibiting adding of nullability in alternative signatures.

This commit is contained in:
Evgeny Gerashchenko
2012-06-21 15:59:22 +04:00
parent a02ab2b348
commit d9127fc34b
4 changed files with 30 additions and 0 deletions
@@ -49,6 +49,11 @@ class AlternativeSignatureParsing {
@Override
public JetType visitNullableType(JetNullableType nullableType, Void data) {
try {
if (!autoType.isNullable()) {
throw new AlternativeSignatureMismatchException(String.format(
"Auto type '%s' is not-null, while type in alternative signature is nullable: '%s'",
DescriptorRenderer.TEXT.renderType(autoType), nullableType.getText()));
}
return TypeUtils.makeNullable(computeAlternativeTypeFromAnnotation(nullableType.getInnerType(), autoType));
}
catch (AlternativeSignatureMismatchException e) {