Skip to content

Conversation

@retronym
Copy link
Member

@retronym retronym commented Jul 8, 2017

In #5327, a change was made to typedEta to accept an
original (ie, pre-typechecked) tree to be used in a
fallback path.

However, the caller provided an original tree larger
than the actual tree being typechecked.

This commit just passes the part of the orig tree that
corresponds to the tree we're eta expanding, rather than
the entire Typed(methodValue, functionPt) tree.

That avoids an infinite loop in typechecking the erroneous
code in the test case.

Fixes scala/bug#10279

@scala-jenkins scala-jenkins added this to the 2.12.4 milestone Jul 8, 2017
@retronym retronym requested a review from adriaanm July 8, 2017 13:28
@retronym
Copy link
Member Author

retronym commented Jul 8, 2017

Review in good time by @adriaanm (if/when the new dependently-typed member allows it.)

// foo(1) _
}

foo(1) _
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add the slightly simpler test case from scala/bug#10299

scala> def foo(implicit x: Int): Int = x
scala> val bar = foo _

Copy link
Contributor

@adriaanm adriaanm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Added Lukas's test case

@lrytz
Copy link
Member

lrytz commented Sep 19, 2017

!!   65 - run/byname.scala                          [output differs]
% diff /home/jenkins/workspace/scala-2.12.x-validate-test@2/test/files/run/byname-run.log /home/jenkins/workspace/scala-2.12.x-validate-test@2/test/files/run/byname.check
@@ -1,4 +1,3 @@
-warning: there were two deprecation warnings (since 2.12.0); re-run with -deprecation for details
 test no braces completed properly
 test no braces r completed properly

retronym and others added 2 commits September 19, 2017 17:37
In scala#5327, a change was made to typedEta to accept an
original (ie, pre-typechecked) tree to be used in a
fallback path.

However, the caller provided an original tree larger
than the actual tree being typechecked.

This commit just passes the part of the orig tree that
corresponds to the tree we're eta expanding, rather than
the entire `Typed(methodValue, functionPt)` tree.

That avoids an infinite loop in typechecking the erroneous
code in the test case.
@adriaanm
Copy link
Contributor

Push -f'ed to Jason's branch again :)

@adriaanm adriaanm merged commit ed764ad into scala:2.12.x Sep 21, 2017
lrytz added a commit to lrytz/scala that referenced this pull request Dec 1, 2017
In scala#6092, `-Xsource:2.13` was enabled by default. Between this PRs
parent and current 2.13.x, there were some changes that depended on
this flag (scala#5983, scala#6069).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants