Skip to content

Variable Argument Lists exercise 1 inherently won't compile or pass #74

Open
@oscaralanpierce

Description

@oscaralanpierce

Hi folks! I'm working through the exercises and realised exercise 1 in the Variable Argument Lists atom seems to have no way to pass in IntelliJ IDEA. I need to capture the output of an error and print it to the console. However, the error to be captured is a compile-time error, not a runtime error, so the program can't even run to print its message. If I don't implement anything, then the tests fail. Am I missing something, or is there just no way to make this exercise pass?

I tried all of these solutions and none worked:

Function declared outside main (wouldn't compile)

// Varargs1/Task.kt
package variableArgumentListsExercise1

import atomictest.capture

fun multipleVarargs(vararg a: Int, vararg b: Double) {}

fun main() {
  println(capture { multipleVarargs(1, 2, 1.0, 2.0) })
}

Function declared inside main (wouldn't compile)

// Varargs1/Task.kt
package variableArgumentListsExercise1

import atomictest.capture

fun main() {
  println(
    capture {
      fun multipleVarargs(vararg a: Int, vararg b: Int) {}
    }
  )
}

Nothing implemented (tests failed)

// Varargs1/Task.kt
package variableArgumentListsExercise1

// TODO

fun main() {
  // TODO
}

Thanks for your time & help!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Variable Argument Lists exercise 1 inherently won't compile or pass · Issue #74 · svtk/AtomicKotlinCourse