David Pollak | 1 Mar 05:40 2007

Compiler stack overflow

Folks,

I'm running into a stack overflow problem compiling some code on a Mac.  I've tried to adjust -Xss but it seems that the compiler always dies with 1024 stack levels.  Any clue how to tell the compiler it should have a deeper stack?

Thanks,

David

--
David Pollak




Eric Willigers | 1 Mar 06:41 2007
Picon

Re: Compiler stack overflow

David Pollak wrote:
> Folks,
> 
> I'm running into a stack overflow problem compiling some code on a Mac.  
> I've tried to adjust -Xss but it seems that the compiler always dies 
> with 1024 stack levels.  Any clue how to tell the compiler it should 
> have a deeper stack?
> 
> Thanks,
> 
> David
> 
> --
> David Pollak
> http://blog.lostlake.org
> 
> 
> 
> 

Hi David,

It could be an infinite recursion bug, in which case a deeper stack 
wouldn't help. See the bug database for some past examples.

In case it does help, scalac reads the same JAVACMD environment variable 
as scala.

JAVACMD="java -Xss<size>" scalac <filenames>

Regards,
Eric.

Iulian Dragos | 1 Mar 10:11 2007
Picon
Picon

Anyone knows how to report a bug in IBM JVM? [was Re: Anyone using the IBM JVM for Scala]

We found the problem: it's zero-length 'InnerClasses' classfile
attributes. The current SVN version has this fixed, but I was trying to
report this back to IBM, since obviously they have a bug. I've been
looking for 1/2 hour already all over the IBM Java Technology page, and
couldn't find any link to a bug reporting tool. Do any of you guys know
how to report a bug to IBM? :-)

Cheers,
Iulian

Stéphane Micheloud wrote:
> David Pollak wrote:
>> Folks,
>>
>> I am trying to use the IBM 1.5 JVM to run Scala.  Just typing "scala"
>> results in a process that uses 100% cpu that must be kill -9'ed to stop it.
>>
>> Anyone out there tried the IBM JVM?
> 
> I have the same problem. Thank you for reporting the issue.
> 
> We'll try to fix that issue before releasing version 2.4.0 of Scala
> (planned for this week).
> 
> 
> Bye
> --Stephane
> 
>> Thanks,
>>
>> David
>>
>>
> 

--

-- 
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Eugene Vigdorchik | 1 Mar 16:43 2007

IntelliScala plugin released

Hello All,

We've released the plugin for Scala version 0.1. You can find it in the plugin repository available
directly in IntelliJ.
The feature highlights are as follows: syntax highlighting, formatting, parsing errors highlighting,
folding, surround with, file
structure outline, keyword completion, goto class, compilation (with no dependent files calculation
yet), debugging, cross-language
resolve of types/find usages/rename of classes and traits.
Hope you find this plugin useful.

Enjoy,
Scala plugin development team

Warren Henning | 1 Mar 17:09 2007
Picon

Re: IntelliScala plugin released

On 3/1/07, Eugene Vigdorchik <ven <at> jetbrains.com> wrote:
> We've released the plugin for Scala version 0.1. You can find it in the plugin repository available
directly in IntelliJ.

JetBrains earns mega karma points for doing this. Extremely cool.

I'm not an IntelliJ IDEA user, but this might force me to download a
demo and see what all the fuss is about.

Warren

Henrik Huttunen | 1 Mar 17:39 2007
Picon
Picon

Re: IntelliScala plugin released

Hello!

> Hope you find this plugin useful.
Haven't tried it yet, and what else can I say than 'I've always wanted 
this!'.
IntelliJ and Eclipse were the most important reasons I had to stick with 
Java. Eventually I got tired of Java, and have been using Scala since. 
Luckily interactive interpreter helps in developing, but there's much 
potential left for a Scala IDE, and you are doing a wonderful thing for 
the future of Scala.

So thank you!

- Henrik

--

-- 
Scalad - a salad of Scala abstractions:
http://users.utu.fi/hvkhut/scalad/scalad.htm

Eugene Vigdorchik | 1 Mar 18:02 2007

FW: IntelliScala plugin released


Hello Bill,

The reason that comes to my mind is that you have IntelliJ 6.0, and the plugin requires 7.0 EAP available on
IntelliJ site
http://www.intellij.net We had to request some modifications to IDEA core to support e.g. debugging scala:(

Eugene.

> -----Original Message-----
> From: Bill Venners [mailto:bv-svp <at> artima.com]
> Sent: Thursday, March 01, 2007 7:48 PM
> To: Eugene Vigdorchik
> Cc: scala <at> listes.epfl.ch
> Subject: Re: IntelliScala plugin released
> 
> Hi Eugene,
> 
> I was unable to see a Scala plug-in listed in Available plug-ins.  
> (And it's was not installed at that point either.) I was able to see 
> it on the website at:
> 
> http://plugins.intellij.net/plugin/?id=1347
> 
> I don't see a way to actually install a plug-in that isn't on the 
> list. It seems like the problem is likely that either it didn't get 
> added to the list of plugins, which I can see IntelliJ trying to 
> download each time, or I'm not able to download the latest list of 
> plugins.
> 
> Any suggestions, including how to install a plug-in by hand? 
> I tried just moving the Jar files into Scala/lib in the plugins 
> directory, and upon restarting IntelliJ, "Scala"
> showed up magically in my list of installed plug-ins, but I got the 
> stack trace pasted below my signature.
> 
> Thanks.
> 
> Bill
> ----
> Bill Venners
> President
> Artima, Inc.
> http://www.artima.com
> 
> Here's the stack trace:
> 
> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
> util/messages/MessageBus;
> java.lang.NoSuchMethodError:  
> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
> util/messages/MessageBus;
> 	at
> org.jetbrains.plugins.scala.cache.module.ScalaModuleCachesManager
> $3.run(Unknown Source)
> 	at com.intellij.ide.startup.impl.StartupManagerImpl.a
> (StartupManagerImpl.java:15)
> 	at
> com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartu
> pActivitie
> s(StartupManagerImpl.java:35)
> 	at
> com.intellij.openapi.project.impl.ProjectManagerImpl.openProject
> (ProjectManagerImpl.java:193)
> 	at
> com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOp
> enProject(
> ProjectManagerImpl.java:19)
> 	at
> com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:38)
> 	at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:27)
> 	at
> com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java: 
> 10)
> 	at com.intellij.idea.IdeaApplication$IdeStarter$2.run
> (IdeaApplication.java:1)
> 	at com.intellij.openapi.application.impl.LaterInvocator
> $FlushQueue.run(LaterInvocator.java:16)
> 	at
> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
> 	at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:8)
> 	at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:36)
> 	at
> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:184)
> 	at java.awt.EventDispatchThread.pumpOneEventForHierarchy
> (EventDispatchThread.java:269)
> 	at java.awt.EventDispatchThread.pumpEventsForHierarchy
> (EventDispatchThread.java:190)
> 	at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
> 184)
> 	at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
> 176)
> 	at
> java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
> 
> 
> 
> java.lang.AbstractMethodError
> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:57)
> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:49)
> 	at com.intellij.lexer.MergingLexerAdapter.start
> (MergingLexerAdapter.java:39)
> 	at
> com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java: 
> 124)
> 	at com.intellij.peer.impl.PeerFactoryImpl.createBuilder
> (PeerFactoryImpl.java:4)
> 	at com.intellij.psi.tree.IChameleonElementType.parseContents
> (IChameleonElementType.java:57)
> 	at com.intellij.psi.impl.source.tree.ChameleonElement.transform
> (ChameleonElement.java:6)
> 	at
> com.intellij.psi.impl.source.parsing.ChameleonTransforming.transform
> (ChameleonTransforming.java:15)
> 	at
> com.intellij.psi.impl.source.tree.ChameleonElement.getTransfor
> medFirstOr
> Self(ChameleonElement.java:27)
> 	at
> com.intellij.psi.impl.source.tree.SharedImplUtil.getFirstChild
> (SharedImplUtil.java:19)
> 	at
> com.intellij.psi.impl.source.TreeWrapperPsiElement.getFirstChild
> (TreeWrapperPsiElement.java:92)
> 	at
> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0$$anon
> $1.<init>(ScalaPsiElement.scala:50)
> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
> $0.elements(ScalaPsiElement.scala:44)
> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
> $0.elements(ScalaPsiElement.scala:43)
> 	at scala.Iterable$class.foldRight(Iterable.scala:283)
> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
> $0.foldRight(ScalaPsiElement.scala:43)
> 	at scala.Iterable$class.$colon$bslash(Iterable.scala:294)
> 	at
> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0. 
> $colon$bslash(ScalaPsiElement.scala:43)
> 	at org.jetbrains.plugins.scala.lang.psi.ScalaFile.getTmplDefs
> (ScalaFile.scala:35)
> 	at
> org.jetbrains.plugins.scala.lang.psi.javaView.ScJavaFile.getClasses
> (ScJavaFile.scala:44)
> 	at
> org.jetbrains.plugins.scala.cache.info.ScalaInfoFactory.create
> ScalaFileI
> nfo(Unknown Source)
> 	at
> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.createSc
> alaFileInf
> o(Unknown Source)
> 	at
> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.regenera
> teFileInfo
> (Unknown Source)
> 	at
> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.getUp2Da
> teFileInfo
> (Unknown Source)
> 	at
> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.addScala
> FileInfos(
> Unknown Source)
> 	at
> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.access$400
> (Unknown Source)
> 	at org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl$1.run
> (Unknown Source)
> 	at
> com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess
> (ProgressManagerImpl.java:38)
> 	at com.intellij.openapi.application.impl.ApplicationImpl
> $1MyThread.run(ApplicationImpl.java:12)
> 
> 
> 
> 
> 
> On Mar 1, 2007, at 7:43 AM, Eugene Vigdorchik wrote:
> 
> > Hello All,
> >
> > We've released the plugin for Scala version 0.1. You can
> find it in
> > the plugin repository available directly in IntelliJ.
> > The feature highlights are as follows: syntax highlighting, 
> > formatting, parsing errors highlighting, folding, surround
> with, file
> > structure outline, keyword completion, goto class, compilation (with 
> > no dependent files calculation yet), debugging, cross-language 
> > resolve of types/find usages/rename of classes and traits.
> > Hope you find this plugin useful.
> >
> > Enjoy,
> > Scala plugin development team
> >
> >
> 
> 
> 
> 
> 
> 

Bill Venners | 1 Mar 20:00 2007

Re: IntelliScala plugin released

Hi Eugene,

I downloaded 7 and then the plugin, and voila, it recognized .scala  
files with a cute little icon with a circle in it. I opened it and  
got syntax highlighting. Very pretty. I will play around with it and  
let you know if I find any issues. Actually I don't have time to play  
with it, but I'll try using it as I do real work in Scala and send  
you feedback.

Thanks very much for doing this plugin.

Bill
----
Bill Venners
President
Artima, Inc.
http://www.artima.com

On Mar 1, 2007, at 9:02 AM, Eugene Vigdorchik wrote:

>
> Hello Bill,
>
> The reason that comes to my mind is that you have IntelliJ 6.0, and  
> the plugin requires 7.0 EAP available on IntelliJ site
> http://www.intellij.net We had to request some modifications to  
> IDEA core to support e.g. debugging scala:(
>
> Eugene.
>
>> -----Original Message-----
>> From: Bill Venners [mailto:bv-svp <at> artima.com]
>> Sent: Thursday, March 01, 2007 7:48 PM
>> To: Eugene Vigdorchik
>> Cc: scala <at> listes.epfl.ch
>> Subject: Re: IntelliScala plugin released
>>
>> Hi Eugene,
>>
>> I was unable to see a Scala plug-in listed in Available plug-ins.
>> (And it's was not installed at that point either.) I was able to see
>> it on the website at:
>>
>> http://plugins.intellij.net/plugin/?id=1347
>>
>> I don't see a way to actually install a plug-in that isn't on the
>> list. It seems like the problem is likely that either it didn't get
>> added to the list of plugins, which I can see IntelliJ trying to
>> download each time, or I'm not able to download the latest list of
>> plugins.
>>
>> Any suggestions, including how to install a plug-in by hand?
>> I tried just moving the Jar files into Scala/lib in the plugins
>> directory, and upon restarting IntelliJ, "Scala"
>> showed up magically in my list of installed plug-ins, but I got the
>> stack trace pasted below my signature.
>>
>> Thanks.
>>
>> Bill
>> ----
>> Bill Venners
>> President
>> Artima, Inc.
>> http://www.artima.com
>>
>> Here's the stack trace:
>>
>> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
>> util/messages/MessageBus;
>> java.lang.NoSuchMethodError:
>> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
>> util/messages/MessageBus;
>> 	at
>> org.jetbrains.plugins.scala.cache.module.ScalaModuleCachesManager
>> $3.run(Unknown Source)
>> 	at com.intellij.ide.startup.impl.StartupManagerImpl.a
>> (StartupManagerImpl.java:15)
>> 	at
>> com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartu
>> pActivitie
>> s(StartupManagerImpl.java:35)
>> 	at
>> com.intellij.openapi.project.impl.ProjectManagerImpl.openProject
>> (ProjectManagerImpl.java:193)
>> 	at
>> com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOp
>> enProject(
>> ProjectManagerImpl.java:19)
>> 	at
>> com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:38)
>> 	at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:27)
>> 	at
>> com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java:
>> 10)
>> 	at com.intellij.idea.IdeaApplication$IdeStarter$2.run
>> (IdeaApplication.java:1)
>> 	at com.intellij.openapi.application.impl.LaterInvocator
>> $FlushQueue.run(LaterInvocator.java:16)
>> 	at
>> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
>> 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
>> 	at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:8)
>> 	at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:36)
>> 	at
>> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:184)
>> 	at java.awt.EventDispatchThread.pumpOneEventForHierarchy
>> (EventDispatchThread.java:269)
>> 	at java.awt.EventDispatchThread.pumpEventsForHierarchy
>> (EventDispatchThread.java:190)
>> 	at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
>> 184)
>> 	at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
>> 176)
>> 	at
>> java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>>
>>
>>
>> java.lang.AbstractMethodError
>> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:57)
>> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:49)
>> 	at com.intellij.lexer.MergingLexerAdapter.start
>> (MergingLexerAdapter.java:39)
>> 	at
>> com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java:
>> 124)
>> 	at com.intellij.peer.impl.PeerFactoryImpl.createBuilder
>> (PeerFactoryImpl.java:4)
>> 	at com.intellij.psi.tree.IChameleonElementType.parseContents
>> (IChameleonElementType.java:57)
>> 	at com.intellij.psi.impl.source.tree.ChameleonElement.transform
>> (ChameleonElement.java:6)
>> 	at
>> com.intellij.psi.impl.source.parsing.ChameleonTransforming.transform
>> (ChameleonTransforming.java:15)
>> 	at
>> com.intellij.psi.impl.source.tree.ChameleonElement.getTransfor
>> medFirstOr
>> Self(ChameleonElement.java:27)
>> 	at
>> com.intellij.psi.impl.source.tree.SharedImplUtil.getFirstChild
>> (SharedImplUtil.java:19)
>> 	at
>> com.intellij.psi.impl.source.TreeWrapperPsiElement.getFirstChild
>> (TreeWrapperPsiElement.java:92)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0$$anon
>> $1.<init>(ScalaPsiElement.scala:50)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.elements(ScalaPsiElement.scala:44)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.elements(ScalaPsiElement.scala:43)
>> 	at scala.Iterable$class.foldRight(Iterable.scala:283)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.foldRight(ScalaPsiElement.scala:43)
>> 	at scala.Iterable$class.$colon$bslash(Iterable.scala:294)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0.
>> $colon$bslash(ScalaPsiElement.scala:43)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaFile.getTmplDefs
>> (ScalaFile.scala:35)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.javaView.ScJavaFile.getClasses
>> (ScJavaFile.scala:44)
>> 	at
>> org.jetbrains.plugins.scala.cache.info.ScalaInfoFactory.create
>> ScalaFileI
>> nfo(Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.createSc
>> alaFileInf
>> o(Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.regenera
>> teFileInfo
>> (Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.getUp2Da
>> teFileInfo
>> (Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.addScala
>> FileInfos(
>> Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.access$400
>> (Unknown Source)
>> 	at org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl$1.run
>> (Unknown Source)
>> 	at
>> com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess
>> (ProgressManagerImpl.java:38)
>> 	at com.intellij.openapi.application.impl.ApplicationImpl
>> $1MyThread.run(ApplicationImpl.java:12)
>>
>>
>>
>>
>>
>> On Mar 1, 2007, at 7:43 AM, Eugene Vigdorchik wrote:
>>
>>> Hello All,
>>>
>>> We've released the plugin for Scala version 0.1. You can
>> find it in
>>> the plugin repository available directly in IntelliJ.
>>> The feature highlights are as follows: syntax highlighting,
>>> formatting, parsing errors highlighting, folding, surround
>> with, file
>>> structure outline, keyword completion, goto class, compilation (with
>>> no dependent files calculation yet), debugging, cross-language
>>> resolve of types/find usages/rename of classes and traits.
>>> Hope you find this plugin useful.
>>>
>>> Enjoy,
>>> Scala plugin development team
>>>
>>>
>>
>>
>>
>>
>>
>>
>
>

Bill Venners | 1 Mar 22:02 2007

Re: IntelliScala plugin released

Hi Eugene,

Well I spent a couple hours working on Scala code in the plug-in. The  
syntax problem red underliner worked for a while, then stopped,  
though it will probably work again when I restart. The syntax  
highlighting seemed perfect. Refactor-->Rename didn't work, though it  
did show up on the menu. When I selected it I just got nothing, and  
it may work when I restart. At some point I think it got a bit  
confused. But it's not bad for version 0.1.

One question I have is will we be able to have different code style  
settings for Java and Scala. I've always used 4 space indentation for  
Java, but have gotten used to 2 space indentation in my small amount  
of Scala programming experience. The plug-in wants to indent the  
Scala code 4 spaces.

Thanks.

Bill
----
Bill Venners
President
Artima, Inc.
http://www.artima.com

On Mar 1, 2007, at 9:02 AM, Eugene Vigdorchik wrote:

>
> Hello Bill,
>
> The reason that comes to my mind is that you have IntelliJ 6.0, and  
> the plugin requires 7.0 EAP available on IntelliJ site
> http://www.intellij.net We had to request some modifications to  
> IDEA core to support e.g. debugging scala:(
>
> Eugene.
>
>> -----Original Message-----
>> From: Bill Venners [mailto:bv-svp <at> artima.com]
>> Sent: Thursday, March 01, 2007 7:48 PM
>> To: Eugene Vigdorchik
>> Cc: scala <at> listes.epfl.ch
>> Subject: Re: IntelliScala plugin released
>>
>> Hi Eugene,
>>
>> I was unable to see a Scala plug-in listed in Available plug-ins.
>> (And it's was not installed at that point either.) I was able to see
>> it on the website at:
>>
>> http://plugins.intellij.net/plugin/?id=1347
>>
>> I don't see a way to actually install a plug-in that isn't on the
>> list. It seems like the problem is likely that either it didn't get
>> added to the list of plugins, which I can see IntelliJ trying to
>> download each time, or I'm not able to download the latest list of
>> plugins.
>>
>> Any suggestions, including how to install a plug-in by hand?
>> I tried just moving the Jar files into Scala/lib in the plugins
>> directory, and upon restarting IntelliJ, "Scala"
>> showed up magically in my list of installed plug-ins, but I got the
>> stack trace pasted below my signature.
>>
>> Thanks.
>>
>> Bill
>> ----
>> Bill Venners
>> President
>> Artima, Inc.
>> http://www.artima.com
>>
>> Here's the stack trace:
>>
>> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
>> util/messages/MessageBus;
>> java.lang.NoSuchMethodError:
>> com.intellij.openapi.project.Project.getMessageBus()Lcom/intellij/
>> util/messages/MessageBus;
>> 	at
>> org.jetbrains.plugins.scala.cache.module.ScalaModuleCachesManager
>> $3.run(Unknown Source)
>> 	at com.intellij.ide.startup.impl.StartupManagerImpl.a
>> (StartupManagerImpl.java:15)
>> 	at
>> com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartu
>> pActivitie
>> s(StartupManagerImpl.java:35)
>> 	at
>> com.intellij.openapi.project.impl.ProjectManagerImpl.openProject
>> (ProjectManagerImpl.java:193)
>> 	at
>> com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOp
>> enProject(
>> ProjectManagerImpl.java:19)
>> 	at
>> com.intellij.ide.impl.ProjectUtil.openProject(ProjectUtil.java:38)
>> 	at com.intellij.idea.IdeaApplication.c(IdeaApplication.java:27)
>> 	at
>> com.intellij.idea.IdeaApplication.access$400(IdeaApplication.java:
>> 10)
>> 	at com.intellij.idea.IdeaApplication$IdeStarter$2.run
>> (IdeaApplication.java:1)
>> 	at com.intellij.openapi.application.impl.LaterInvocator
>> $FlushQueue.run(LaterInvocator.java:16)
>> 	at
>> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
>> 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
>> 	at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:8)
>> 	at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:36)
>> 	at
>> com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:184)
>> 	at java.awt.EventDispatchThread.pumpOneEventForHierarchy
>> (EventDispatchThread.java:269)
>> 	at java.awt.EventDispatchThread.pumpEventsForHierarchy
>> (EventDispatchThread.java:190)
>> 	at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
>> 184)
>> 	at
>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
>> 176)
>> 	at
>> java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>>
>>
>>
>> java.lang.AbstractMethodError
>> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:57)
>> 	at com.intellij.lexer.FlexAdapter.start(FlexAdapter.java:49)
>> 	at com.intellij.lexer.MergingLexerAdapter.start
>> (MergingLexerAdapter.java:39)
>> 	at
>> com.intellij.lang.impl.PsiBuilderImpl.<init>(PsiBuilderImpl.java:
>> 124)
>> 	at com.intellij.peer.impl.PeerFactoryImpl.createBuilder
>> (PeerFactoryImpl.java:4)
>> 	at com.intellij.psi.tree.IChameleonElementType.parseContents
>> (IChameleonElementType.java:57)
>> 	at com.intellij.psi.impl.source.tree.ChameleonElement.transform
>> (ChameleonElement.java:6)
>> 	at
>> com.intellij.psi.impl.source.parsing.ChameleonTransforming.transform
>> (ChameleonTransforming.java:15)
>> 	at
>> com.intellij.psi.impl.source.tree.ChameleonElement.getTransfor
>> medFirstOr
>> Self(ChameleonElement.java:27)
>> 	at
>> com.intellij.psi.impl.source.tree.SharedImplUtil.getFirstChild
>> (SharedImplUtil.java:19)
>> 	at
>> com.intellij.psi.impl.source.TreeWrapperPsiElement.getFirstChild
>> (TreeWrapperPsiElement.java:92)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0$$anon
>> $1.<init>(ScalaPsiElement.scala:50)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.elements(ScalaPsiElement.scala:44)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.elements(ScalaPsiElement.scala:43)
>> 	at scala.Iterable$class.foldRight(Iterable.scala:283)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon
>> $0.foldRight(ScalaPsiElement.scala:43)
>> 	at scala.Iterable$class.$colon$bslash(Iterable.scala:294)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.ScalaPsiElement$$anon$0.
>> $colon$bslash(ScalaPsiElement.scala:43)
>> 	at org.jetbrains.plugins.scala.lang.psi.ScalaFile.getTmplDefs
>> (ScalaFile.scala:35)
>> 	at
>> org.jetbrains.plugins.scala.lang.psi.javaView.ScJavaFile.getClasses
>> (ScJavaFile.scala:44)
>> 	at
>> org.jetbrains.plugins.scala.cache.info.ScalaInfoFactory.create
>> ScalaFileI
>> nfo(Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.createSc
>> alaFileInf
>> o(Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.regenera
>> teFileInfo
>> (Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.getUp2Da
>> teFileInfo
>> (Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.addScala
>> FileInfos(
>> Unknown Source)
>> 	at
>> org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl.access$400
>> (Unknown Source)
>> 	at org.jetbrains.plugins.scala.cache.ScalaFilesCacheImpl$1.run
>> (Unknown Source)
>> 	at
>> com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess
>> (ProgressManagerImpl.java:38)
>> 	at com.intellij.openapi.application.impl.ApplicationImpl
>> $1MyThread.run(ApplicationImpl.java:12)
>>
>>
>>
>>
>>
>> On Mar 1, 2007, at 7:43 AM, Eugene Vigdorchik wrote:
>>
>>> Hello All,
>>>
>>> We've released the plugin for Scala version 0.1. You can
>> find it in
>>> the plugin repository available directly in IntelliJ.
>>> The feature highlights are as follows: syntax highlighting,
>>> formatting, parsing errors highlighting, folding, surround
>> with, file
>>> structure outline, keyword completion, goto class, compilation (with
>>> no dependent files calculation yet), debugging, cross-language
>>> resolve of types/find usages/rename of classes and traits.
>>> Hope you find this plugin useful.
>>>
>>> Enjoy,
>>> Scala plugin development team
>>>
>>>
>>
>>
>>
>>
>>
>>
>
>

Rickard Nilsson | 1 Mar 22:21 2007
Picon

Implicit conversion inside for-expression

Hi,

I tried to use an implicit conversion inside a for-expression, but  
couldn't get it to work.

   object Test {

     implicit def fromOption[A](o: Option[A]): Seq[A] = o match {
       case Some(x) => x::Nil
       case None    => Nil
     }

     val l: Seq[Int] = for (val i <- Some(5)) yield i

   }

This code gave the error message:

   no type parameters for method map: ((scala.Int) => B)scala.Option[B]  
exist
   so that it can be applied to arguments ((scala.Int) => scala.Int)
   --- because ---
   result type scala.Option[B] is incompatible with expected type  
scala.Seq[scala.Int]
     val l: Seq[Int] = for (val i <- Some(5)) yield i

However, when I explicitly used the function, it worked fine:

   val l: Seq[Int] = for (val i <- fromOption(Some(5))) yield i

Is this kind of implicit type conversion too complex for Scala to handle?

Regards,
   Rickard


Gmane