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

Loading…
Cancel
Save