Scala project fails to compile: illegal characters in sources

694 views
Skip to first unread message

André van Delft

unread,
Dec 28, 2012, 6:34:02 PM12/28/12
to scala-i...@googlegroups.com
I try to compile in Eclipse the scala sources that I just got from GitHub, but this fails.
Symbols "⇒" and "→" are not interpreted well. In the editor they show up as '‚áí' and Üí.
Also "¬" causes problems.
The compiler reports 31 errors, mostly  "⇒" and "¬" as illegal characters '\u201a' and '\u00a8'; see below

How can I bypass these problems for now?
Is this going to be fixed in a new release of the Scala-IDE?

Versions:
Mac OS X 10.8.2
Eclipse Juno Release 1
Scala IDE for Eclipse 2.1.0.m3-2_10-201212191037-79b3311
Scala master branch 2.10.0-wip
Description Resource Path Location Typeillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 535 Scala Problemidentifier expected but something found. Predef.scala /scala/src/library/scala line 279 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 536 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 557 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 558 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 132 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 133 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 152 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 152 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 562 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 563 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 564 Scala Problem'=' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 132 Scala Problemillegal character '\u00a8' Duration.scala /scala/src/library/scala/concurrent/duration line 558 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 559 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 560 Scala Problemillegal character '\u201a' Duration.scala /scala/src/library/scala/concurrent/duration line 561 Scala Problemillegal start of simple expression Duration.scala /scala/src/library/scala/concurrent/duration line 536 Scala Problem'=' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 535 Scala Problem'=>' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 557 Scala Problem';' expected but something found. ModelFactoryTypeSupport.scala /scala/src/compiler/scala/tools/nsc/doc/model line 195 Scala Problem';' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 536 Scala Problem';' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 133 Scala Problemunclosed character literal ModelFactoryTypeSupport.scala /scala/src/compiler/scala/tools/nsc/doc/model line 195 Scala Problemillegal start of simple expression Duration.scala /scala/src/library/scala/concurrent/duration line 133 Scala Problemunclosed character literal ModelFactoryTypeSupport.scala /scala/src/compiler/scala/tools/nsc/doc/model line 195 Scala Problemillegal start of simple expression Duration.scala /scala/src/library/scala/concurrent/duration line 154 Scala Problem')' expected but something found. Duration.scala /scala/src/library/scala/concurrent/duration line 152 Scala Problemillegal character '\u201a' Future.scala /scala/src/library/scala/concurrent line 14 Scala Problem'}' expected but something found. Future.scala /scala/src/library/scala/concurrent line 14 Scala Problemillegal character '\u201a' Predef.scala /scala/src/library/scala line 279 Scala Problem


Simon Schäfer

unread,
Dec 28, 2012, 6:55:58 PM12/28/12
to scala-i...@googlegroups.com
Are the characters invalid or is it only the IDE that parses them
wrong, i.e. when you look with an arbitrary editor to the sources do
the expected signs occur or are they broken there too?

On Sa 29 Dez 2012 00:34:02 CET, André van Delft wrote:
> I try to compile in Eclipse the scala sources that I just got from
> GitHub, but this fails.
> Symbols "⇒" and "→" are not interpreted well. In the editor they show
> up as '‚áí' and ‚Üí.
> Also "¬" causes problems.
> The compiler reports 31 errors, mostly "⇒" and "¬" as illegal
> character <https://github.com/scala/scala/tree/2.10.0-wip>s '\u201a'
> <https://github.com/scala/scala/tree/2.10.0-wip> and '\u00a8'
> <https://github.com/scala/scala/tree/2.10.0-wip>; see below
>
> How can I bypass these problems for now?
> Is this going to be fixed in a new release of the Scala-IDE?
>
> *Versions*:
> Mac OS X 10.8.2
> Eclipse Juno Release 1
> Scala IDE for Eclipse 2.1.0.m3-2_10-201212191037-79b3311
> Scala master branch 2.10.0-wip
> <https://github.com/scala/scala/tree/2.10.0-wip>
> <https://github.com/scala/scala/tree/2.10.0-wip><https://github.com/scala/scala/tree/2.10.0-wip>*DescriptionResourcePathLocationType*
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 535Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>identifier expected
> but something found.Predef.scala/scala/src/library/scalaline 279Scala
> Problem <https://github.com/scala/scala/tree/2.10.0-wip>illegal
> character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 536Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 557Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 558Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 132Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 133Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 152Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 152Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 562Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 563Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 564Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>'='
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 132Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u00a8'Duration.scala/scala/src/library/scala/concurrent/durationline
> 558Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 559Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 560Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Duration.scala/scala/src/library/scala/concurrent/durationline
> 561Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal start of
> simple
> expressionDuration.scala/scala/src/library/scala/concurrent/durationline
> 536Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>'='
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 535Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>'=>'
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 557Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>';'
> expected but something
> found.ModelFactoryTypeSupport.scala/scala/src/compiler/scala/tools/nsc/doc/modelline
> 195Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>';'
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 536Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>';'
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 133Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>unclosed character
> literalModelFactoryTypeSupport.scala/scala/src/compiler/scala/tools/nsc/doc/modelline
> 195Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal start of
> simple
> expressionDuration.scala/scala/src/library/scala/concurrent/durationline
> 133Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>unclosed character
> literalModelFactoryTypeSupport.scala/scala/src/compiler/scala/tools/nsc/doc/modelline
> 195Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal start of
> simple
> expressionDuration.scala/scala/src/library/scala/concurrent/durationline
> 154Scala Problem <https://github.com/scala/scala/tree/2.10.0-wip>')'
> expected but something
> found.Duration.scala/scala/src/library/scala/concurrent/durationline
> 152Scala Problem
> <https://github.com/scala/scala/tree/2.10.0-wip>illegal character
> '\u201a'Future.scala/scala/src/library/scala/concurrentline 14Scala
> Problem <https://github.com/scala/scala/tree/2.10.0-wip>'}' expected
> but something
> found.Future.scala/scala/src/library/scala/concurrentline 14Scala
> Problem <https://github.com/scala/scala/tree/2.10.0-wip>illegal
> character '\u201a'Predef.scala/scala/src/library/scalaline 279Scala
> Problem <https://github.com/scala/scala/tree/2.10.0-wip>
>
>

Som Snytt

unread,
Dec 28, 2012, 6:56:21 PM12/28/12
to scala-i...@googlegroups.com
On Fri, Dec 28, 2012 at 3:34 PM, André van Delft <andre.v...@gmail.com> wrote:
I try to compile in Eclipse the scala sources that I just got from GitHub, but this fails.
Symbols "⇒" and "→" are not interpreted well. In the editor they show up as '‚áí' and Üí.
Also "¬" causes problems.
The compiler reports 31 errors, mostly  "⇒" and "¬" as illegal characters '\u201a' and '\u00a8'; see below

How can I bypass these problems for now?


 Prefs > General > Workspace

has text encoding options, for UTF-8.

André van Delft

unread,
Dec 28, 2012, 8:12:15 PM12/28/12
to scala-i...@googlegroups.com
Thank you very much for your prompt replies, Simon and Som. 
The sources contain the appropriate characters.
The UTF-8 setting has helped.

Googling on "scala eclipse plugin utf-8" I found that the IDE FAQ also addresses this issue.
I installed JRE7 to prevent Eclipse from freezing, and that helps as well.

But I got the UTF-8 problem back again, after removing my project from Eclipse and importing the scala files again.  This is how:

My directory structure is
.../workspace-subscript/scala/ with {build.examples.xml, ..., docs/, ..., lib/, ..., project, ..., src/, ...}

I did: File >> Import Projects >> Ok with Root directory = workspace-subscript/scala

This created a new project named Scala. 
After rebuilding there were 22 errors in Duration.scala, Predef.scala, ModelFactoryTypeSupport.scala; again the character encoding problems, even though the text file encoding setting is UTF-8.

Line 9 in Duration.scala contains the text 
package scala.concurrent.duration
This appears red underlined in the editor. A red error marker in the margin has hover text:

Presentation compiler crashed while type checking this file: java.lang.AssertionError: assertion failed: List(Nothing <and> Nothing, Any <and> Any)

Maybe I should create my Eclipse project in another way. Any ideas?

Op zaterdag 29 december 2012 00:56:21 UTC+1 schreef Som Snytt het volgende:

iulian dragos

unread,
Jan 4, 2013, 8:18:25 AM1/4/13
to scala-i...@googlegroups.com
Are you trying to build the Scala compiler/library sources in Eclipse? You should follow the steps outlined in the docs:


The Scala compiler has Eclipse projects under src/eclipse. Follow the tutorial linked above for the best results :)

iulian
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Reply all
Reply to author
Forward
0 new messages