Warning, /frameworks/syntax-highlighting/autotests/input/test.kt is written in an unsupported language. File is not indexed.

0001 package org.example
0002 
0003 fun main(args: Array<String>) {
0004     val sum1 = add(5, 6)
0005     println(sum1)
0006     println("""
0007 $$a${1+2}\$$
0008 abc
0009 """)
0010 }
0011  
0012 /**
0013 * add function with two, three or four integer arguments
0014 * c : default argument is 0
0015 * d : default argument is 0
0016 */
0017 fun add(a:Int, b:Int, c:Int = 0, d:Float = 12e10F): Int {
0018     return a + b + c + d
0019 } 
0020 
0021 public class MyTest {
0022     lateinit var subject: TestSubject
0023 
0024     val dyn: dynamic
0025 
0026     @get:Rule val tempFolder = TemporaryFolder()
0027 
0028     @set:[Inject VisibleForTesting]
0029     var collaborator: Collaborator
0030 
0031     @SetUp fun setup() {
0032         subject = TestSubject()
0033     }
0034 
0035     fun @receiver:Fancy String.myExtension() {
0036 
0037     }
0038 
0039     @Test fun test() {
0040         subject.method()  // dereference directly
0041     }
0042 }
0043 
0044 import /* comment */ foo.Foo // comment
0045 class /* comment */ Foo {
0046     fun /* comment */ foo(/* comment */) {
0047 
0048     }
0049 
0050     val /* comment */ bar = 1
0051     var /* comment */ baz = 2
0052 }