> That's weird because the return type of an if w/o else is always Unit.
>
> You may have a little trouble simulating this without Lift as the input type
> to replyTo (the thing that the type inferencer seems to be cranky about) is
> a view bounds and then the subclass is Long (superclass trait Thing[Owner <:
> Mapper[Owner], T]{ def apply[U <% T]: Owner = ... }
> ReplyToThing[MappedMessage, Long]{ ... })

The "bug" can be experienced with any of the members extending
MappedLongForeignKey, but not MappedLong.

As seems to be the case with most complicated Scala typing puzzles,
implicits are involved. Using the -Xprint:typer debugging option, I
have confirmed that replyTo is converted to Long using MappedField's
mapToType implicit. What's really strange, though, is that this
implicit is only used when the problematic statement is at the end of
a Unit block.

> Also, this may be fixed in 2.7.4.  Once we get Lift 1.1M1 out the door this
> weekend, we're going to turn to doing a maintenance release of 1.0 by
> upgrading to 2.7.4 and patching a few bugs (e.g., there are textile parsing
> bugs.)  This issue may be fixed in 2.7.4.

Alas, it's not fixed in 2.7.4, but I don't consider it critical. I was
hoping I would understand more about Scala's typing rules,
specifically regarding implicits.

At this point it's too much time for me to delve into this, but I
wanted to share some details to anyone who's interested in debugging
this.

Vassil

Reply via email to