Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8147277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:17:55+00:00 2026-06-06T14:17:55+00:00

The help menu of the Scala compiler (2.9.2) says -print Print program with Scala-specific

  • 0

The help menu of the Scala compiler (2.9.2) says

-print   Print program with Scala-specific features removed.

But the following call with the -print option shows Scala-specific features:

C:\Users\John\Test Scala Project\src\main\scala>type test.scala
trait A

C:\Users\John\Test Scala Project\src\main\scala>scalac -print test.scala
[[syntax trees at end of cleanup]]// Scala source: test.scala
package <empty> {
  abstract trait A extends java.lang.Object
}

Why is the trait still shown ? I would have expected pure Java code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:17:57+00:00Added an answer on June 6, 2026 at 2:17 pm

    The description is deceiving indeed, but it never said it would print Java code. It couldn’t do that anyway: Scala generates valid bytecode, but not bytecode that can be directly translated into Java.

    What it does is generate code after the cleanup phase. Now, if you try -Xshow-phases on Scala 2.9.2, you’ll see this:

        phase name  id  description
        ----------  --  -----------
            parser   1  parse source into ASTs, perform simple desugaring
             namer   2  resolve names, attach symbols to named trees
    packageobjects   3  load package objects
             typer   4  the meat and potatoes: type the trees
    superaccessors   5  add super accessors in traits and nested classes
           pickler   6  serialize symbol tables
         refchecks   7  reference/override checking, translate nested objects
      selectiveanf   8
          liftcode   9  reify trees
      selectivecps  10
           uncurry  11  uncurry, translate function values to anonymous classes
         tailcalls  12  replace tail calls by jumps
        specialize  13  @specialized-driven class and method specialization
     explicitouter  14  this refs to outer pointers, translate patterns
           erasure  15  erase types, add interfaces for traits
          lazyvals  16  allocate bitmaps, translate lazy vals into lazified defs
        lambdalift  17  move nested functions to top level
      constructors  18  move field definitions into constructors
           flatten  19  eliminate inner classes
             mixin  20  mixin composition
           cleanup  21  platform-specific cleanups, generate reflective calls
             icode  22  generate portable intermediate code
           inliner  23  optimization: do inlining
          closelim  24  optimization: eliminate uncalled closures
               dce  25  optimization: eliminate dead code
               jvm  26  generate JVM bytecode
          terminal  27  The last phase in the compiler chain
    

    Note that cleanup is the last phase before icode, and that’s really the point. The parameter -print prints stuff after everything that changes the abstract syntax tree had a go at it. When the AST is about ready for code generation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following the help menu for PasteSpecial but I cannot seem to get
I need to put a custom hover menu from http://www.addthis.com/help/toolbox , but Rails uses
I want to add my own sub menu option under the help menu of
I'm desperately searching for the keystroke to access a help menu from my Java
I'm pretty sure i've seen this somewhere (not counting the help menu), and I
can any body help me the create a menu(Home, My Quote, Send a Quote)
I'm trying to create a custom HTML Helper to help simplify my masterpages menu,
I need to create HTML pop-up menu using Perl. Can anyone help me?
in my app the android default menu button is not visible? why? Any help?
Help! I'm using the ASP.Net Login control on a Login page, but the Login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.