Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Wojtek Pituła
    @Krever
    I have very little experience with macros but I was thinking about having something like def text[T](thunk: =>T) = macro xxxand then rely on rangepos to get relevant part of the file. But this a long shot as I have never done it before and rely only on stuff I heard , so I cant say if it can work
    Li Haoyi
    @lihaoyi
    possible. RangePos didnt work well back in 2.11 and 2.12, but maybe now in 2.13 they’ve fixed all the old issues
    Matt Hicks
    @darkfrog26

    Is this incorrect usage?

    object Test {
      def test()(implicit file: sourcecode.File, line: sourcecode.Line): Unit = {
        println(s"Called from: $file, $line")
      }
    }

    I'm getting [E047] Cyclic Error when I try to use that on Dotty

    Li Haoyi
    @lihaoyi
    looks fine, might be a bug in dotty
    Oron Port
    @soronpo
    @darkfrog26 Maybe in dotty use using instead of implicit
    Matt Hicks
    @darkfrog26
    @soronpo same error
    @lihaoyi has this project not been tested on Dotty?
    Li Haoyi
    @lihaoyi
    you'll need to ask the dotty folks
    Oron Port
    @soronpo
    It's part of the dotty community build. What dotty version are you using?
    Matt Hicks
    @darkfrog26
    @soronpo 0.27.0-RC1
    Oron Port
    @soronpo
    Try the nightly
    You will need to compile sourcecode locally for it
    Matt Hicks
    @darkfrog26
    looks like 3.0.0-M1 was released 11 hours ago
    Oron Port
    @soronpo
    There is a tag. I don't know if it was actually published. I know there were issues with that.
    Matt Hicks
    @darkfrog26
    yeah, apparently publishing failed
    Matt Hicks
    @darkfrog26
    How do I get the class name using sourcecode? I want package.class but there doesn't appear to be any way to get that directly
    I suppose I could use Pkg and FileName, remove .scala from the end of the filename and then concatenate them...
    Matt Hicks
    @darkfrog26
    Any information on when sourcecode will support Scala.js on Dotty?
    Li Haoyi
    @lihaoyi
    FullName?
    Matt Hicks
    @darkfrog26
    @lihaoyi doesn't FullName potentially include method name as well? I'd still have to break it out, right?
    Matt Hicks
    @darkfrog26
    @lihaoyi any idea when a new release will be out supporting Dotty 3.0.0-M1?
    Tobias Roeser
    @lefou
    Please push the latest release tag(s) to github
    Matt Hicks
    @darkfrog26
    why is sourcecode not publishing for Scala.js on 3.0.0-RC1?
    The support for releases on this project is awful. I submitted a ticket at the end of January (com-lihaoyi/sourcecode#100) for a bug in the release and haven't even gotten a response. I guess I'll have to branch the project and do my own release.
    Matt Hicks
    @darkfrog26
    Done! I created a fork (https://github.com/outr/sourcecode) that restructures the directories and added a build.sbt file, and published under my organization: "com.outr" %%% "sourcecode" % "0.2.4" and has support for Scala.js + 3.0.0-RC1
    Darren Bishop
    @DarrenBishop
    hi folks. how do you pass a Name or Line to a macro behind a function that wants to do something with that meta-data
    ?
    Oron Port
    @soronpo
    I don't understand what you are trying to do.
    Darren Bishop
    @DarrenBishop
    nevermind, figured it out. I misread/misunderstood the error message i got
    i am writing a function and macro pair; the function has implicits i.e. Name and Line etc, that i want to propagate to my macro
    all good now though :thumbsup: