Skip to content

Instantly share code, notes, and snippets.

@sonumehrotra
Last active March 7, 2021 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonumehrotra/95b3693f649ef511eae65b0ca9cbccbe to your computer and use it in GitHub Desktop.
Save sonumehrotra/95b3693f649ef511eae65b0ca9cbccbe to your computer and use it in GitHub Desktop.
object CompanySalaryApplication:
case class Employee(name: String, salary: Int)
case class CompanyBonus(amount: Int)
trait SalaryComputation:
def computeSalary(employee: Employee)(using companyBonus: CompanyBonus): Int =
employee.salary + companyBonus.amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment