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

Compiler crash when .value, etc... used outside of task macro #1031

Closed
harrah opened this issue Dec 7, 2013 · 1 comment
Closed

Compiler crash when .value, etc... used outside of task macro #1031

harrah opened this issue Dec 7, 2013 · 1 comment
Assignees
Labels
Milestone

Comments

@harrah
Copy link
Member

harrah commented Dec 7, 2013

This was caused by the removal of resetLocalAttrs. When .value, etc... are used properly, the task/setting macros remove them as part of macro expansion. When they are not removed, they survive beyond typers. Therefore, problems with untyped trees from the .value-like macros are only exposed when used in the wrong context.

@ghost ghost assigned harrah Dec 7, 2013
harrah added a commit that referenced this issue Dec 10, 2013
retronym added a commit to retronym/sbt that referenced this issue Jan 28, 2014
Untyped trees underneath typed trees makes Jack and sad boy.
And they make superaccessors a sad phase.

The recent refactoring to retain original types in the trees
representing the argument to the task macro meant that the `value`
macro also was changed to try to avoid this untyped-under-typed
problem. However, it didn't go deep enough, and left the child
trees of the placeholder tree `InputWrapper.wrap[T](key)` untyped.

This commit uses `c.typeCheck` to locally typeheck that tree fully
instead.

Fixes sbt#1031
retronym added a commit to retronym/sbt that referenced this issue Jan 28, 2014
Untyped trees underneath typed trees makes Jack and sad boy.
And they make superaccessors a sad phase.

The recent refactoring to retain original types in the trees
representing the argument to the task macro meant that the `value`
macro also was changed to try to avoid this untyped-under-typed
problem. However, it didn't go deep enough, and left the child
trees of the placeholder tree `InputWrapper.wrap[T](key)` untyped.

This commit uses `c.typeCheck` to locally typeheck that tree fully
instead.

Fixes sbt#1031
@retronym
Copy link
Member

@harrah If I remove the setType and omit the manual call to c.typeCheck, we get:

$q124 tpe is null
    at scala.tools.nsc.transform.UnCurry$UnCurryTransformer.mainTransform(UnCurry.scala:684)
    at scala.tools.nsc.transform.UnCurry$UnCurryTransformer.transform(UnCurry.scala:122)
    at scala.tools.nsc.transform.UnCurry$UnCurryTransformer.transform(UnCurry.scala:82)
    at scala.reflect.internal.Trees$class.itransform(Trees.scala:1272)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
    at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:13)
    at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2897)

harrah added a commit that referenced this issue Mar 21, 2014
eed3si9n pushed a commit to eed3si9n/sbt that referenced this issue Mar 21, 2014
Untyped trees underneath typed trees makes Jack and sad boy.
And they make superaccessors a sad phase.

The recent refactoring to retain original types in the trees
representing the argument to the task macro meant that the `value`
macro also was changed to try to avoid this untyped-under-typed
problem. However, it didn't go deep enough, and left the child
trees of the placeholder tree `InputWrapper.wrap[T](key)` untyped.

This commit uses `c.typeCheck` to locally typeheck that tree fully
instead.

Fixes sbt#1031
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants