Allow assigning array to vararg in named form in annotations

See more in KT-20171
This commit is contained in:
Mikhail Zarechenskiy
2017-09-13 16:05:46 +03:00
parent f905d56b38
commit 68259f7939
26 changed files with 410 additions and 96 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -866,6 +866,10 @@ public abstract class KotlinBuiltIns {
return classFqNameEquals(descriptor, FQ_NAMES.array) || getPrimitiveArrayType(descriptor) != null;
}
public static boolean isArrayOrPrimitiveArray(@NotNull KotlinType type) {
return isArray(type) || isPrimitiveArray(type);
}
public static boolean isPrimitiveArray(@NotNull KotlinType type) {
ClassifierDescriptor descriptor = type.getConstructor().getDeclarationDescriptor();
return descriptor != null && getPrimitiveArrayType(descriptor) != null;