Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
What's the point of "val variable =" following by nothing in Kotlin?

I accidentally hit enter after a value assignment and to my surprise it compiled perfectly fine!

What's the point of having this syntax? I tried to search for it online but only found articles about the Nothing-type, but nowhere close to this surprising syntax.

Syntax from IntelliJ Idea

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Technically, return 123 is an expression which returns Nothing. Just like throw RuntimeException(). You can save the result of this expression in your variable but I cannot imagine how you can use it :)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!