Kotlin unexpected `unresolved reference`

Viewed 2699

I'm a beginner to Kotlin, and here's my code:

class C(val boy: Int = 0) {
    fun <T, E> boy(i: Int) = i
}

fun girl(b1: Boolean, b2: Boolean) = println("boy($b1, $b2)")

fun main(args: Array<String>): Unit {
    val A = 234 // see? A defined!
    val B = 345 // see? B defined!
    val c = C(123) // c is also defined!

    girl(c.boy < A, B > A) // hey look at here
}

IntelliJ IDEA gives me:

  • unresolved reference: A
  • unresolved reference: B
  • unresolved reference: c

At the line hey look at here.

I think my code is syntactically correct, what's wrong?

2 Answers
Related