Skip to content

Spurious/inaccurate error messages when quoting #6783

Closed
@biboudis

Description

@biboudis

minimized code

  def testImpl(f: (Expr[Int], Expr[Int]) => Expr[Int]): Expr[Int] = f('{1}, '{2})

  inline def test(f: (Int, Int) => Int) = ${
    testImpl((a: Expr[Int], b: Expr[Int]) =>  '{ f(${a}, ${b}) }) // error: splice outside quotes
  }

  test((a, b) => a + b)
  def testImpl(f: Expr[(Int, Int) => Int]): Expr[Int] = f('{1}, '{2})

  inline def test(f: (Int, Int) => Int) = ${
    testImpl('f)
  } // malformed macro

  test((a, b) => a + b)

expectation

I think the first one has an inaccurate error message while the second should have passed. @nicolasstucki WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions