Skip to content

scalac compiler and scala REPL should treat shebangs as comments #8660

@scabug

Description

@scabug

For example, :load <script>.scala currently triggers an error in the scala REPL, but not when the same file is run with scala <script>.scala or ./<script>.scala. That seems a bit silly, when the shebang could simply be treated as a comment.

It would be a great convenience if the scalac compiler and scala REPL treated shebangs (#!/usr/bin/env scala) on the first line of a scala file as a comment.

Use cases:

  • Flexibly convert between script-style and compile-style code
  • Better first-time experience for Unix coders
  • Better Windows support for Unix-style code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions