Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danascheider opened this issue Jul 12, 2023 · 0 comments
Open

Comments

@danascheider
Copy link

danascheider commented Jul 12, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant