Skip to content
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

Fix some varargs issues in scala 2 and scala 3 #433

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Commits on Feb 29, 2024

  1. https://github.com/lightbend-labs/scala-logging/issues/354

    After wrapping varargs, the user code fails to compile.
    
    In Scala 2, there were no inline parameters, and the subtype of args was obtained during compilation. However, this approach may not always be accurate.
    
    Regarding #191
    
    There is an issue with obtaining inline parameters in Scala 3.
    
    To address this, we recursively obtain the actual value of inline parameters. This necessitates the ongoing use of inlining in the parameters of the wrapper function. For instance:
    
    ```scala
    class LogWrapper(val underlying: Logger) {
        inline def info(message: String, inline args: AnyRef*): Unit = underlying.info(message, args: _*)
    }
    ```
    This ensures compatibility and accurate handling of inline parameters in both Scala 2 and Scala 3.
    jxnu-liguobin committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    7c1a32d View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2024

  1. Configuration menu
    Copy the full SHA
    1cbde29 View commit details
    Browse the repository at this point in the history
  2. Fix for varargs

    jxnu-liguobin committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    ac2ed10 View commit details
    Browse the repository at this point in the history
  3. Fix for varargs

    jxnu-liguobin committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    14db4cb View commit details
    Browse the repository at this point in the history
  4. Fix for varargs

    jxnu-liguobin committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    a6e2c8b View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2024

  1. fixes #436

    jxnu-liguobin committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    59603af View commit details
    Browse the repository at this point in the history
  2. fix fmt

    jxnu-liguobin committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    eba83bc View commit details
    Browse the repository at this point in the history
  3. fix fmt

    jxnu-liguobin committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    1de9edc View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2024

  1. fix test

    jxnu-liguobin committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    84698ea View commit details
    Browse the repository at this point in the history