File tree Expand file tree Collapse file tree 6 files changed +48
-6
lines changed
java/kotlin-extractor/src/main/kotlin/utils/versions Expand file tree Collapse file tree 6 files changed +48
-6
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
9
9
10
10
@OptIn(ObsoleteDescriptorBasedAPI ::class )
11
11
fun isUnderscoreParameter (vp : IrValueParameter ) =
12
- DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)?.safeAs<KtParameter >()?.isSingleUnderscore == true
12
+ try {
13
+ DescriptorToSourceUtils .getSourceFromDescriptor(vp.descriptor)
14
+ ?.safeAs<KtParameter >()?.isSingleUnderscore == true
15
+ } catch (e: NotImplementedError ) {
16
+ // Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
17
+ // be applied to synthetic functions.
18
+ false
19
+ }
You can’t perform that action at this time.
0 commit comments