Skip to content

refactor: replace deprecated extends App with explicit main method#178

Merged
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:remove-deprecated-extends-app
Jul 6, 2026
Merged

refactor: replace deprecated extends App with explicit main method#178
He-Pin merged 1 commit into
apache:mainfrom
He-Pin:remove-deprecated-extends-app

Conversation

@He-Pin

@He-Pin He-Pin commented Jul 6, 2026

Copy link
Copy Markdown
Member

Motivation

extends App is deprecated in Scala 3. Replace with explicit def main(args: Array[String]): Unit method for forward compatibility.

Modification

Replace object X extends App { ... } with object X { def main(args: Array[String]): Unit = { ... } } in doc example and test files.

Result

No more usage of deprecated scala.App trait. Code is compatible with Scala 3.

Tests

Not run - docs only

References

None - Scala 3 compatibility

Motivation:
`extends App` is deprecated in Scala 3. Replace with explicit `def main`
method for forward compatibility.

Modification:
Replace `object X extends App { ... }` with
`object X { def main(args: Array[String]): Unit = { ... } }`
in 5 sample application files.

Result:
No more usage of deprecated `scala.App` trait. Code is compatible with Scala 3.

Tests:
Not run - docs only

References:
None - Scala 3 compatibility

@pjfanning pjfanning left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@He-Pin
He-Pin merged commit 0e6b505 into apache:main Jul 6, 2026
2 checks passed
@He-Pin
He-Pin deleted the remove-deprecated-extends-app branch July 6, 2026 08:24
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 this pull request may close these issues.

2 participants