Skip to content

Commit 07f340a

Browse files
committed
Cleanup
1 parent cd096c3 commit 07f340a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

BridgeFeatures.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Reported when `@JvmBlockingBridge` is applied to a function which either:
122122
- is in `inline` class
123123
- has parameter types or return type that is `inline` classes
124124

125-
#### `UNSUPPORTED_BLOCKING_BRIDGES_IN_INTERFACE`
125+
#### `INTERFACE_NOT_SUPPORTED`
126126
Reported when `@JvmBlockingBridge` is applied to a function in an interface, and the JVM target is below 8
127127

128128
### Warnings
@@ -133,7 +133,5 @@ Reported when `@JvmBlockingBridge` is applied to a function which is either:
133133
- in `private` classes, interfaces, enums or objects.
134134

135135
#### `OVERRIDING_GENERATED_BLOCKING_BRIDGE`
136+
*(TODO)*
136137
Reported when overriding generated bridges from Java or Kotlin.
137-
138-
#### `IMPLICIT_OVERRIDE_BY_JVM_BLOCKING_BRIDGE`
139-
Reported when bridges are overriding or hiding a super member.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
Kotlin compiler plugin for generating blocking bridges for calling suspend functions from Java with minimal effort
66

77
## Screenshots
8+
<details>
9+
<summary>Click to expand</summary>
810
Kotlin suspend functions:
911
![image_2.png](https://i.loli.net/2020/08/08/d5cYwhQqeuj8Nvf.png)
1012

@@ -13,6 +15,7 @@ Bridge method calls:
1315

1416
Documentation and navigation support:
1517
![image_1](https://i.loli.net/2020/08/08/koCl6zj4OAJ5aUN.png)
18+
</details>
1619

1720
### Motivation
1821
Kotlin suspend function is compiled with an additional `$completion: Continuation` parameter, making it hard to call from Java, so we often make extra effort to simplify calling.

compiler-plugin/src/main/java/net/mamoe/kjbb/compiler/diagnostic/BlockingBridgeErrors.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface BlockingBridgeErrors {
1414
// DiagnosticFactory0<PsiElement> PLUGIN_IS_NOT_ENABLED = DiagnosticFactory0.create(WARNING);
1515
DiagnosticFactory0<PsiElement> INAPPLICABLE_JVM_BLOCKING_BRIDGE = DiagnosticFactory0.create(ERROR);
1616
DiagnosticFactory1<PsiElement, DeclarationDescriptor> INLINE_CLASSES_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR);
17-
DiagnosticFactory0<PsiElement> INTERFACE_NOT_SUPPORTED_BELOW_JAVA8 = DiagnosticFactory0.create(ERROR);
17+
DiagnosticFactory0<PsiElement> INTERFACE_NOT_SUPPORTED = DiagnosticFactory0.create(ERROR);
1818
DiagnosticFactory0<PsiElement> REDUNDANT_JVM_BLOCKING_BRIDGE_ON_PRIVATE_DECLARATIONS = DiagnosticFactory0.create(WARNING);
1919

2020
DiagnosticFactory1<PsiElement, String> OVERRIDING_GENERATED_BLOCKING_BRIDGE = DiagnosticFactory1.create(WARNING);

compiler-plugin/src/main/kotlin/net/mamoe/kjbb/compiler/backend/jvm/analyzing.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sealed class BlockingBridgeAnalyzeResult(
4949
class InterfaceNotSupported(
5050
private val inspectionTarget: PsiElement,
5151
) : BlockingBridgeAnalyzeResult(false) {
52-
override fun createDiagnostic(): Diagnostic? = INTERFACE_NOT_SUPPORTED_BELOW_JAVA8.on(inspectionTarget)
52+
override fun createDiagnostic(): Diagnostic? = INTERFACE_NOT_SUPPORTED.on(inspectionTarget)
5353
}
5454

5555
class InlineClassesNotSupported(

compiler-plugin/src/main/kotlin/net/mamoe/kjbb/compiler/diagnostic/BlockingBridgeErrorsRendering.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object BlockingBridgeErrorsRendering : DefaultErrorMessages.Extension {
3636
)
3737

3838
put(
39-
INTERFACE_NOT_SUPPORTED_BELOW_JAVA8,
39+
INTERFACE_NOT_SUPPORTED,
4040
"Interface is not supported for jvm target lower than 8"
4141
)
4242
}

0 commit comments

Comments
 (0)