Don't require to override abstract methods in expect class

#KT-16099 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-10-05 01:59:02 +03:00
parent 5695e76a00
commit 88595e1a58
17 changed files with 334 additions and 7 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.
@@ -458,7 +458,11 @@ public class DescriptorUtils {
KotlinTypeChecker.DEFAULT.equalTypes(builtIns.getAnyType(), type);
}
public static boolean classCanHaveAbstractMembers(@NotNull ClassDescriptor classDescriptor) {
public static boolean classCanHaveAbstractFakeOverride(@NotNull ClassDescriptor classDescriptor) {
return classCanHaveAbstractDeclaration(classDescriptor) || classDescriptor.isExpect();
}
public static boolean classCanHaveAbstractDeclaration(@NotNull ClassDescriptor classDescriptor) {
return classDescriptor.getModality() == Modality.ABSTRACT
|| isSealedClass(classDescriptor)
|| classDescriptor.getKind() == ClassKind.ENUM_CLASS;