Re: Toolbox typecheck throws MatchError for higher-kinded path-dependent type
Oliver Ruebenacker <[email protected]>
| Newsgroups | gmane.comp.lang.scala |
|---|---|
| Message-ID | <CAA=X4OAmREy1YNiw51oZOb+82faNzv2EE6veyUQ_z_YfKPfXxQ@mail.gmail.com> |
Hello,
Very roughly, how does treatment of code snippets compare among Toolbox,
IMain and the standard REPL (aka Scala Shell)? Thanks!
Best, Oliver
On Thu, Jul 30, 2015 at 4:01 AM, Jason Zaugg <[email protected]> wrote:
> Toolbox's main claim to fame is that, like runtime reflection, it uses a
> classpath backed by a Java class loader. With a plain global you need a
> list of JARs or class directories (in my example we told it to get that
> from the -classpath arg of the JVM.
>
> Toolbox also makes it convenient to run the code and to work with snippets
> , rather than complete compilation units.
>
> Toolbox itself extends Global. For both of them, it's fine (and necessary)
> to have an instance per thread.
>
> Jason
>
> On Wed, 29 Jul 2015 at 11:26 pm Daniel Armak <[email protected]> wrote:
>
>> Thanks Jason!
>>
>> So, if I only need to compare the compiled code's Types with the host
>> code, and not to export or import Trees, then the ToolBox doesn't do
>> anything that Global can't do better?
>>
>> Can I use per-thread instances of Global in parallel as I do with
>> ToolBox? The name 'Global' is a bit worrying in that regard.
>>
>> Daniel Armak
>>
>> On Wed, Jul 29, 2015 at 3:59 PM, Jason Zaugg <[email protected]> wrote:
>>
>>> On Wed, Jul 29, 2015 at 6:18 PM Daniel Armak <[email protected]> wrote:
>>>
>>>> This example produces an untyped tree (run.units.toList.head.body.tpe
>>>> is NoType).
>>>>
>>> An untyped tree has a null type, NoType is the result of typechecking
>>> things like PackageDef / ClassDef / DefDef trees.
>>>
>>> I’ve updated the gist to include the output of show(tree, printTypes =
>>> true) that shows the types you’ll find deeper in the tree.
>>>
>>> -jason
>>>
>>>
>> --
>>>
>> You received this message because you are subscribed to the Google Groups
>>> "scala-language" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "scala-language" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Oliver Ruebenacker
Senior Software Engineer, Diabetes Portal
<http://www.type2diabetesgenetics.org/>, Broad Institute
<http://www.broadinstitute.org/>
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.