Skip to content

Using Cons bypasses Option.Get violation #804

@Johnnei

Description

@Johnnei
val a = 4
val b = 0
val d = scala.util.Try { a / b }.toOption
val list = 42 :: d.get :: Nil

Quite contrived example which I made while testing the gitlab code quality integration. This doesn't flag for using Option.get.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions