Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: Scala 2.11.0-M2
    • Fix Version/s: Scala 2.11.0-M3
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      It would save 6 chars if we had an implicit conversion from BooleanSetting to Boolean.

        Activity

        Hide
        A. P. Marki added a comment -

        https://github.com/scala/scala/pull/2272

        Save a few bytes, spend a few bytes.

        This isn't news; I just wanted to see if the #devWarning syntax worked.

        scala> :javap build/quick/classes/compiler/scala/tools/nsc/Global.class#devWarning
          public final void devWarning(scala.Function0<java.lang.String>);
            flags: ACC_PUBLIC, ACC_FINAL
            Code:
              stack=5, locals=2, args_size=2
                 0: getstatic     #1296               // Field scala/tools/nsc/settings/AbsScalaSettings$.MODULE$:Lscala/tools/nsc/settings/AbsScalaSettings$;
                 3: aload_0      
                 4: invokevirtual #1219               // Method settings:()Lscala/tools/nsc/Settings;
                 7: invokeinterface #1312,  1         // InterfaceMethod scala/tools/nsc/settings/ScalaSettings.developer:()Lscala/tools/nsc/settings/MutableSettings$BooleanSetting;
                12: invokevirtual #1305               // Method scala/tools/nsc/settings/AbsScalaSettings$.valueOfBooleanSetting:(Lscala/tools/nsc/settings/AbsSettings$AbsSetting;)Z
                15: ifne          36
                18: getstatic     #1296               // Field scala/tools/nsc/settings/AbsScalaSettings$.MODULE$:Lscala/tools/nsc/settings/AbsScalaSettings$;
                21: aload_0      
                22: invokevirtual #1219               // Method settings:()Lscala/tools/nsc/Settings;
                25: invokeinterface #1301,  1         // InterfaceMethod scala/tools/nsc/settings/ScalaSettings.debug:()Lscala/tools/nsc/settings/MutableSettings$BooleanSetting;
                30: invokevirtual #1305               // Method scala/tools/nsc/settings/AbsScalaSettings$.valueOfBooleanSetting:(Lscala/tools/nsc/settings/AbsSettings$AbsSetting;)Z
        
        Show
        A. P. Marki added a comment - https://github.com/scala/scala/pull/2272 Save a few bytes, spend a few bytes. This isn't news; I just wanted to see if the #devWarning syntax worked. scala> :javap build/quick/classes/compiler/scala/tools/nsc/Global.class#devWarning public final void devWarning(scala.Function0<java.lang.String>); flags: ACC_PUBLIC, ACC_FINAL Code: stack=5, locals=2, args_size=2 0: getstatic #1296 // Field scala/tools/nsc/settings/AbsScalaSettings$.MODULE$:Lscala/tools/nsc/settings/AbsScalaSettings$; 3: aload_0 4: invokevirtual #1219 // Method settings:()Lscala/tools/nsc/Settings; 7: invokeinterface #1312, 1 // InterfaceMethod scala/tools/nsc/settings/ScalaSettings.developer:()Lscala/tools/nsc/settings/MutableSettings$BooleanSetting; 12: invokevirtual #1305 // Method scala/tools/nsc/settings/AbsScalaSettings$.valueOfBooleanSetting:(Lscala/tools/nsc/settings/AbsSettings$AbsSetting;)Z 15: ifne 36 18: getstatic #1296 // Field scala/tools/nsc/settings/AbsScalaSettings$.MODULE$:Lscala/tools/nsc/settings/AbsScalaSettings$; 21: aload_0 22: invokevirtual #1219 // Method settings:()Lscala/tools/nsc/Settings; 25: invokeinterface #1301, 1 // InterfaceMethod scala/tools/nsc/settings/ScalaSettings.debug:()Lscala/tools/nsc/settings/MutableSettings$BooleanSetting; 30: invokevirtual #1305 // Method scala/tools/nsc/settings/AbsScalaSettings$.valueOfBooleanSetting:(Lscala/tools/nsc/settings/AbsSettings$AbsSetting;)Z
        Hide
        Paolo G. Giarrusso added a comment -

        Not really a big trouble, but it doesn't look like @inline worked.

        Show
        Paolo G. Giarrusso added a comment - Not really a big trouble, but it doesn't look like @inline worked.
        Hide
        A. P. Marki added a comment -

        The supersessive PR: https://github.com/scala/scala/pull/2327

        That may not be a word sanctioned by the dictionary.

        Show
        A. P. Marki added a comment - The supersessive PR: https://github.com/scala/scala/pull/2327 That may not be a word sanctioned by the dictionary.
        Hide
        A. P. Marki added a comment -

        There are no trivial issues, only trivial issues with fixes to trivial issues.

        Show
        A. P. Marki added a comment - There are no trivial issues, only trivial issues with fixes to trivial issues.

          People

          • Assignee:
            A. P. Marki
            Reporter:
            A. P. Marki
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development