Skip to content

Should inline matches strip type ascription? #11291

Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.0.0.M3

Minimized example

inline def meth =
  inline ("a": Any) match
    case _: String => "ok"

def test = meth

Output

-- Error: Foo.scala:6:11 -------------------------------------------------------
6 |def test = meth
  |           ^^^^
  |           cannot reduce inline match with
  |            scrutinee:  "a":Any : Any
  |            patterns :  case _:String
  | This location contains code that was inlined from Foo.scala:3

Expectation

Should this code compile? It looks like it should. Not sure if there are use-cases where we would want to avoid this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions