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

FullName does not work in for loops #37

Open
Atry opened this issue Aug 18, 2017 · 1 comment
Open

FullName does not work in for loops #37

Atry opened this issue Aug 18, 2017 · 1 comment

Comments

@Atry
Copy link

Atry commented Aug 18, 2017

Welcome to the Ammonite Repl 1.0.1
(Scala 2.12.3 Java 1.8.0_131)
If you like Ammonite, please support our development at www.patreon.com/lihaoyi
@ import $ivy.`com.lihaoyi::sourcecode:0.1.4` 
import $ivy.$                              

@ def loop = {
    for (i <- 0 until 1) {
      println(implicitly[sourcecode.FullName])
    }
  } 
defined function loop

@ loop 
FullName(ammonite.$sess.cmd1.$anonfun)

The loop function should be present in FullName. Unfortunately it is not.

@Atry Atry changed the title FullName does not work in for loop FullName does not work in for loop Aug 18, 2017
@Atry Atry changed the title FullName does not work in for loop FullName does not work in for loops Aug 18, 2017
@Krever
Copy link

Krever commented Apr 4, 2022

I noticed related but probably different misbehavior.

@ def test(): Unit = {
        for {
          _ <- Option(())
          _ <- {
            println(implicitly[sourcecode.FullName])
            Option(())
          }
        } ()
      }
defined function test

@ test
FullName(ammonite.$sess.cmd2)

It starts to work if the initial step is removed:

@     def test2(): Unit = {
        for {
          _ <- {
            println(implicitly[sourcecode.FullName])
            Option(())
          }
        } ()
      }
defined function test2

@ test2
FullName(ammonite.$sess.cmd4.test2)

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

No branches or pull requests

2 participants