From 1bf76107518850c8e97878dadbd2be395204168f Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 18 Mar 2015 21:03:11 +0300 Subject: [PATCH] Minor in JS frontend: fix compiler warnings. --- .../jetbrains/kotlin/js/resolve/nativeAnnotationCheckers.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/nativeAnnotationCheckers.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/nativeAnnotationCheckers.kt index a69cfe9919e..fdebcbd3f77 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/nativeAnnotationCheckers.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/nativeAnnotationCheckers.kt @@ -92,7 +92,8 @@ public class NativeGetterChecker : AbstractNativeIndexerChecker(PredefinedAnnota override fun additionalCheck(declaration: JetNamedFunction, descriptor: FunctionDescriptor, diagnosticHolder: DiagnosticSink) { super.additionalCheck(declaration, descriptor, diagnosticHolder) - if (!TypeUtils.isNullableType(descriptor.getReturnType())) { + val returnType = descriptor.getReturnType() + if (returnType != null && !TypeUtils.isNullableType(returnType)) { diagnosticHolder.report(ErrorsJs.NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE.on(declaration)) } } @@ -103,7 +104,7 @@ public class NativeSetterChecker : AbstractNativeIndexerChecker(PredefinedAnnota super.additionalCheck(declaration, descriptor, diagnosticHolder) val returnType = descriptor.getReturnType() - if (KotlinBuiltIns.isUnit(returnType)) return + if (returnType == null || KotlinBuiltIns.isUnit(returnType)) return val parameters = descriptor.getValueParameters() if (parameters.size() < 2) return