Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unused local from HasNoScope macro #9690

@amumurst

Description

@amumurst

The HasNoScope type added in #9604 triggered some unused local warnings when I tried to update zio-http to 3.1.0

I managed to minimize the issue from originally being a part of a for-comprehension over ZIO using the zio-http server https://github.com/zio/zio-http/pull/3276/files#diff-15253ca7746d023f47e1c8c4c34e48cbfcd752426fac4b0f9536279e9a7c4b7bR37 down to the value being a part of any local scope (not only map/flatMap)

main.sc

//> using dep "dev.zio::zio-http:3.1.0"
//> using options "-Wunused:locals" "-Xfatal-warnings"

import zio.*
val x: HasNoScope[Any] = HasNoScope.hasNoScope[Any] //Works
val z: HasNoScope[Any] = { HasNoScope.hasNoScope[Any] } //Warning

output

[error] ./main.sc:6:49
[error] unused local definition
[error] val z: HasNoScope[Any] = { HasNoScope.hasNoScope[Any] } //Unused
[error]         

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions