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

Source.valid says 'invalid' for valid trees #366

Open
ggevay opened this issue Apr 6, 2018 · 2 comments
Open

Source.valid says 'invalid' for valid trees #366

ggevay opened this issue Apr 6, 2018 · 2 comments
Labels

Comments

@ggevay
Copy link
Contributor

ggevay commented Apr 6, 2018

For example:

{
  val x = 7
  x
}

or

println(5)

Btw. after fixing it, we might add it at the beginning of the compiler pipeline, to have nice error msgs when the user tries to run invalid code. (Maybe switchable from config if it has too large overhead.)

@ggevay ggevay added the bug label Apr 6, 2018
@joroKr21
Copy link
Member

joroKr21 commented Jun 4, 2018

I tried to add a failing test in SourceLangSpec but it didn't fail :D

@ggevay
Copy link
Contributor Author

ggevay commented Jun 4, 2018

So if I add the following code at the end of SourceLangSpec

  "aaaa" - {
    "bbbb" in {

      val t = reify {
        val x = 7
        x
      }

      println(Source.valid(t.tree))
    }
  }

then it prints:

Bad(One(Not a term:
{
  val x = 7;
  x
}))

It should say that it is valid, right? Or am I misunderstanding something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants