Skip to content

domain-modelling-tools: Use name argument in abstract class #2278

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

Closed
arkivm opened this issue Dec 18, 2021 · 1 comment · Fixed by #2279
Closed

domain-modelling-tools: Use name argument in abstract class #2278

arkivm opened this issue Dec 18, 2021 · 1 comment · Fixed by #2279

Comments

@arkivm
Copy link
Contributor

arkivm commented Dec 18, 2021

In Scala 3 Book, under Abstract classes, the example for an abstract class that can take arguments doesn't really use the argument.

abstract class Pet(name: String):
  def greeting: String
  def age: Int
  override def toString = s"I say $greeting, and I’m $age"

However, the immediate example that shows "traits with parameters" use them.

I'd be happy to send a PR.

@Philippus
Copy link
Member

That would be great @arkivm !

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

Successfully merging a pull request may close this issue.

2 participants