This page is no longer maintained — Please continue to the home page at www.scala-lang.org

the <:< crasher

1 reply
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

I don't know how to track this any further, so here you go:

% scala -optimise
scala> def foo = Stream.range(1, 1000) flatMap (x => Some(x))
Exception in thread "main" java.lang.AssertionError: assertion failed: could not find toMap: (x$1: scala.collection.TraversableOnce,x$2: Predef$<:<)scala.collection.immutable.Map
(x$1: scala.collection.TraversableOnce,x$2: Predef$<:<)scala.collection.immutable.Mapinside: List(constructor TraversableOnce$class)

The assertion failing is trying to find the toMap method. It's in
there, and it looks like the same method, but scala denies this since it
feels that the <:< parameter in TraversableOnce is not =:= to the <:<
parameter it's seeking.

It feels like it must be a consequence of specialization but I don't
have the mad skillz necessary to grok that in one day.

Iulian Dragos 2
Joined: 2009-02-10,
User offline. Last seen 42 years 45 weeks ago.
Re: the <:< crasher
Thanks for trimming it down. I am looking at the actor tests first, and then I'll tackle this one. 

On Tue, Apr 13, 2010 at 8:32 AM, Paul Phillips <paulp@improving.org> wrote:
I don't know how to track this any further, so here you go:

% scala -optimise
scala> def foo =  Stream.range(1, 1000) flatMap (x => Some(x))
Exception in thread "main" java.lang.AssertionError: assertion failed: could not find toMap: (x$1: scala.collection.TraversableOnce,x$2: Predef$<:<)scala.collection.immutable.Map
(x$1: scala.collection.TraversableOnce,x$2: Predef$<:<)scala.collection.immutable.Mapinside: List(constructor TraversableOnce$class)

The assertion failing is trying to find the toMap method.  It's in
there, and it looks like the same method, but scala denies this since it
feels that the <:< parameter in TraversableOnce is not =:= to the <:<
parameter it's seeking.

It feels like it must be a consequence of specialization but I don't
have the mad skillz necessary to grok that in one day.

--
Paul Phillips      | Appreciation is a wonderful thing; it makes what is
Everyman           | excellent in others belong to us as well.
Empiricist         |     -- Voltaire
pp: i haul pills   |----------* http://www.improving.org/paulp/ *----------



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

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland