https://kotlinlang.org logo
Title
g

groostav

09/14/2018, 6:56 PM
Hey so, does anybody else intentionally leave compiler errors on their branches while they're working so that when they come back to their work they'll have a tool telling them explicitly what they were working on? Is there a kotlin language feature that will let me do this? I figured some kind of use-anywhere style annotation might be more elegant. something like
@CompilerFailure("my custom message")
s

Shawn

09/14/2018, 7:00 PM
leave in errors on branches?
like are you checking in uncompilable code?
s

Sam

09/14/2018, 7:05 PM
I guess, something like C preprocessor's #error
r

robstoll

09/14/2018, 7:11 PM
Why not just write what you should do? that will most likely result in a compile error as well.
g

gcx11

09/14/2018, 7:23 PM
You can just mark unfinished parts of code with TODO https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html It is also supported in IJ Idea https://www.jetbrains.com/help/idea/todo-tool-window.html
a

arocnies

09/14/2018, 7:32 PM
Yup,
TODO("My custom message")
is what I use most of the time
Defining a type as the
Nothing
type is also nice. I use
Nothing
when I have yet to create that type.
c

christophsturm

09/14/2018, 8:50 PM
a failing test or a test with
@Disabled
annotation
g

groostav

09/14/2018, 8:55 PM
all of these suggestions are runtime errors, meaning I actually have to run something to encounter these messages. I want to hit the play button in intelliJ and, without any of my code running, have a message that tells me what to do
@Shawn yes I'm checking in uncompilable code on feature branches. We use a squash-and-rebase flow for feature branches when we merge, so you cant see them after the work is done.
c

christophsturm

09/14/2018, 8:57 PM
when i hit the play button in idea it runs the test suite so my failing test will fail
a

arocnies

09/14/2018, 9:10 PM
TODO's give you a list you can access and jump to in Intellij. It will also warn you if you try to commit TODO's. It's not quite what you want since it does let you compile the code