dstarcev
02/19/2018, 3:48 PM@Qualifier(value = MyClass::class.qualifiedName)
jw
02/19/2018, 5:42 PMribesg
02/20/2018, 3:23 AMOlekss
02/20/2018, 10:23 AMelizarov
02/20/2018, 11:47 AMreified
in Kotlin only reifies classes, but it does not reify types. Now String
and String?
are different types, but they have the same class.elizarov
02/20/2018, 11:48 AMT::class
, there is no T::type
so far)Rick
02/20/2018, 3:32 PMigor.wojda
02/20/2018, 6:04 PMcreate 2 templates, one for test class and one for test method
.
First of all, I tried to setup Kotlin specific template for Junit4 Test Method
template, but there is none. Yes we can use java code that will be converted into Kotlin, but we would lose some Kotlin specific constructs like latent
...but, unfortunately even Java version does not work at all
https://youtrack.jetbrains.com/issue/KT-22937
I also tried to generate whole test class from Junit 4 Test Class
template, but again lack of Kotlin specific language constructs and J2K conversion process makes use of templates a bit unpredictable and problematic eg. I want lateinit and yes I want empty class with empty body (J2K removes this body, but I need it to add tests there)
https://youtrack.jetbrains.com/issue/KT-22120
Since both of above code templates
failed to generate proper test method/class I started looking into live templates as a hack or way around the problem. I was able to create a template for generating test method. With test class template I used groovyScript expression
(painful to implement, annoying to test, impossible to debug?) to process some strings but still failed a bit because I was not able to retrieve the path of the current file to generate the proper package name (for empty Kotlin file where I want to use this template). I described my ‘get file path’ problem on 3 separate groups, 0 answers…
My point here is that in Kotlin there are multiple problems with Kotlin code/file/live templates and currently templates are unusable or VERY difficult to use. I think someone should look at it at ‘bigger picture’ and try to fix “Kotlin-template user experience’rtsypuk
02/20/2018, 10:07 PMRoguenet
02/20/2018, 11:20 PMfun Any.foo() = javaClass.name
rocketraman
02/20/2018, 11:20 PMClass
Ted Williams
02/21/2018, 6:10 AMJarek
02/21/2018, 10:04 AMlouiscad
02/21/2018, 10:55 AMfabricio
02/21/2018, 2:05 PM@ClassRule
i n kotlin?
@ClassRule
public static Neo4jRule neo4j = new Neo4jRule();
I tried
@ClassRule
var neo4j = Neo4jRule()
but it says The @ClassRule 'neo4j' must be public
fabricio
02/21/2018, 2:15 PMcompanion object {
@ClassRule
@JvmField
val neo4j = Neo4jRule()
}
now I get this error:
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@6778aea6' was successfully initialized, but failed to start. Please see the attached cause exception "io.netty.handler.ssl.SslContext.newServerContextInternal(Lio/netty/handler/ssl/SslProvider;Ljava/security/Provider;[Ljava/security/cert/X509Certificate;Ljavax/net/ssl/TrustManagerFactory;[Ljava/security/cert/X509Certificate;Ljava/security/PrivateKey;Ljava/lang/String;Ljavax/net/ssl/KeyManagerFactory;Ljava/lang/Iterable;Lio/netty/handler/ssl/CipherSuiteFilter;Lio/netty/handler/ssl/ApplicationProtocolConfig;JJLio/netty/handler/ssl/ClientAuth;[Ljava/lang/String;ZZ)Lio/netty/handler/ssl/SslContext;".
sujin
02/21/2018, 2:16 PMcompanion object
and object
similar in some sense?sujin
02/21/2018, 2:18 PMabstract
class or object
?David R.
02/21/2018, 3:15 PMClass<Enum> enumType = type.getContentType().getRawClass() as Class<Enum>
EnumSet.noneOf(enumType)
However, the kotlin version does not like the types if implemented as followed
val enumType = type.contentType.rawClass as Class<Enum<*>>
EnumSet.noneOf(enumType)
The error kotlin displays on the noneOf call is about Enum<*> not being a subtype of Enum<Enum<*>>. Is there any way to make this work? Thanks!Michael Jagielo
02/21/2018, 4:15 PMjw
02/21/2018, 4:30 PMmap
and observeOn
orderdead.fish
02/21/2018, 6:53 PMevkaky
02/21/2018, 7:39 PMjtonic
02/21/2018, 8:11 PMjtonic
02/22/2018, 5:10 AMOlekss
02/22/2018, 12:27 PMRuckus
02/22/2018, 2:44 PMBaseNavigator
. Unless BaseNavigator
is a subclass of NavigationController
(it's not, you have it the other way around), that won't compile.poohbar
02/22/2018, 6:26 PMech0s7r
02/22/2018, 11:22 PMkarelpeeters
02/23/2018, 10:29 AMmap
.karelpeeters
02/23/2018, 10:29 AMmap
.ilya.gorbunov
02/23/2018, 12:07 PMkarelpeeters
02/23/2018, 12:14 PMsingleMap
, but that's stretching it. run
doesn't really capture what it does though...