Prohibit incorrect annotations with use-site targets more precisely
#KT-21696 Fixed The problem is coming from the fact that `AnnotationTarget.VALUE_PARAMETER` is mapped to receiver parameter and to value parameter, but annotation with use-site target `receiver` can be used only on type reference of receiver parameter
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.descriptors.annotations
|
||||
@@ -40,8 +29,6 @@ enum class KotlinTarget(val description: String, val isDefault: Boolean = true)
|
||||
FILE("file", false),
|
||||
TYPEALIAS("typealias", false),
|
||||
|
||||
RECEIVER("receiver", true),
|
||||
|
||||
TYPE_PROJECTION("type projection", false),
|
||||
STAR_PROJECTION("star projection", false),
|
||||
PROPERTY_PARAMETER("property constructor parameter", false),
|
||||
@@ -126,7 +113,7 @@ enum class KotlinTarget(val description: String, val isDefault: Boolean = true)
|
||||
AnnotationUseSiteTarget.FILE to FILE,
|
||||
AnnotationUseSiteTarget.PROPERTY_GETTER to PROPERTY_GETTER,
|
||||
AnnotationUseSiteTarget.PROPERTY_SETTER to PROPERTY_SETTER,
|
||||
AnnotationUseSiteTarget.RECEIVER to RECEIVER,
|
||||
AnnotationUseSiteTarget.RECEIVER to VALUE_PARAMETER,
|
||||
AnnotationUseSiteTarget.SETTER_PARAMETER to VALUE_PARAMETER,
|
||||
AnnotationUseSiteTarget.PROPERTY_DELEGATE_FIELD to FIELD)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user