Browse Source

Rearrange experimental annotations so they're not exposed.

Only annotate internal methods, suppress the messages otherwise,
so users of the library don't have to deal with warnings
tags/v0.7.0
Chris Smith 5 years ago
parent
commit
929c4a41b2
2 changed files with 7 additions and 2 deletions
  1. 3
    0
      CHANGELOG
  2. 4
    2
      src/main/kotlin/com/dmdirc/ktirc/IrcClient.kt

+ 3
- 0
CHANGELOG View File

@@ -1,5 +1,8 @@
1 1
 vNEXT (in development)
2 2
 
3
+ * Fixed experimental API warnings when using IrcClient
4
+ * (Internal) Minor version updates for Gradle, Kotlin and JUnit
5
+
3 6
 v0.6.0
4 7
 
5 8
  * Changed USER command to not send the server name, per modern standards

+ 4
- 2
src/main/kotlin/com/dmdirc/ktirc/IrcClient.kt View File

@@ -87,14 +87,15 @@ interface IrcClient {
87 87
 // TODO: How should alternative nicknames work?
88 88
 // TODO: Should IRC Client take a pool of servers and rotate through, or make the caller do that?
89 89
 // TODO: Should there be a default profile?
90
-@KtorExperimentalAPI
91
-@ExperimentalCoroutinesApi
92 90
 class IrcClientImpl(private val server: Server, override val profile: Profile) : IrcClient, CoroutineScope {
93 91
 
94 92
     private val log by logger()
95 93
 
94
+    @ExperimentalCoroutinesApi
96 95
     override val coroutineContext = GlobalScope.newCoroutineContext(Dispatchers.IO)
97 96
 
97
+    @ExperimentalCoroutinesApi
98
+    @KtorExperimentalAPI
98 99
     internal var socketFactory: (CoroutineScope, String, Int, Boolean) -> LineBufferedSocket = ::KtorLineBufferedSocket
99 100
 
100 101
     override val serverState = ServerState(profile.initialNick, server.host)
@@ -115,6 +116,7 @@ class IrcClientImpl(private val server: Server, override val profile: Profile) :
115 116
     override fun connect() {
116 117
         check(!connecting.getAndSet(true))
117 118
 
119
+        @Suppress("EXPERIMENTAL_API_USAGE")
118 120
         with(socketFactory(this, server.host, server.port, server.tls)) {
119 121
             // TODO: Proper error handling - what if connect() fails?
120 122
             socket = this

Loading…
Cancel
Save