Skip to content

Typing error while compiling value classes from TASTY #3462

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

Closed
nicolasstucki opened this issue Nov 12, 2017 · 2 comments
Closed

Typing error while compiling value classes from TASTY #3462

nicolasstucki opened this issue Nov 12, 2017 · 2 comments

Comments

@nicolasstucki
Copy link
Contributor

When compiling from tasty (tests in tests/posFromTasty/)

package foo
class Foo(a: Int) extends AnyVal

When recompiling the code loaded from tasty there is a type mismatch in

exception while typing $this.a.==(x$0.a) of class class dotty.tools.dotc.ast.Trees$Apply # 7640
exception while typing x$0 match 
  {
    case x$0 @ _: foo.Foo => $this.a.==(x$0.a)
    case _: Any => false
  } of class class dotty.tools.dotc.ast.Trees$Match # 7648

...
checking simpleValueClass1.scala after phase MegaPhase{checkStatic, elimRepeated, normalizeFlags, extmethods, expandSAMs, tailrec, byNameClosures, liftTry, hoistSuperArgs, classOf, refchecks}
java.lang.AssertionError: assertion failed: found:    x$0.a.type
required: Any

The issue is that x$0.a.type as no type.

@nicolasstucki
Copy link
Contributor Author

This can be reproduced with

echo "package foo\nclass Foo(a: Int) extends AnyVal\n" > Foo.scala
sbt "dotc Foo.scala"
sbt "dotc -tasty -classpath . foo.Foo"

@nicolasstucki nicolasstucki changed the title Typing error while compiling value classes from tasty Typing error while compiling value classes from TASTY Nov 30, 2017
@nicolasstucki
Copy link
Contributor Author

Now it can also be reproduced with

dotc <source>
dotc -decompile -Ycheck:all Test

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 30, 2017
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 30, 2017
@smarter smarter closed this as completed in 85be781 Dec 7, 2017
smarter added a commit that referenced this issue Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant