Would it be a completely crazy idea to allow for o...
# language-evolution
s
Would it be a completely crazy idea to allow for one file to contribute to multiple source-sets? E.g.
Copy code
fun myProductionFun(){ ... }

@TestSource
fun testMyProductionFun(){ ... }
plus1 1
while compiling main, compiler would simply ignore anything with @TestSource annotation, but when compiling test target, it would only compile @TestSource annotated elements.
Could make e.g. multiplatform development much nicer experience, to cut out the folder-hopping etc.
j
You are looking for test fixtures but they are not working with Kotlin Multiplatform yet
s
I think test fixtures are something else. Test source was just one example, but I'm asking about the principle of different source-sets referencing the same code file. Another example would be to have JVM, JS and Native actual functions in the same file as their expect function, but distinguished by annotations rather than what directory they live in.