logo       

Re: Possible unboxed tuples bug.: msg#00054

lang.haskell.glasgow.bugs

Subject: Re: Possible unboxed tuples bug.

Sean writes:
> Yesterday while I was mucking around in GHCi I discovered the following
> anomaly. (The same holds for compiled code.)
>
> I typed
>
> > :t (# 2, 3 #)
>
> and got back
>
> (# 2, 3 #) :: forall t t1. (Num t, Num t1) => (# t, t1 #)
>
> But when I typed
>
> :t (# 2, 3 #) :: (# Int, Int #)
>
> I got the following
>
> Illegal unboxed tuple type as function argument: (# Int, Int #)
> In an expression type signature: (# Int, Int #)
> In the type signature of the expression: (# 2, 3 #) :: (# Int, Int
> #)
> In the definition of `it': it = (# 2, 3 #) :: (# Int, Int #)
> Is this correct behaviour?

Hi,

This is __pure speculation__, but it looks like a possible bug
in TcMType.checkValidType and friends.

The error message says that you can't have an unboxed tuple as an argument
to a function. However, this is not an argument.

In
check_tau_type rank ubx_tup ty@(TyConApp tc tys)

it has a test:

ubx_tup_ok gla_exts = case ubx_tup of { UT_Ok -> gla_exts; other -> False }

which returns False when "ubx_tup" is not "UT_Ok". And this appears to
trigger the error message.

However, it looks like, it is "UT_NotOk", as passed down from checkValidType.

Of course I could be way off track. The logic in this piece of the compiler is
very tricky.

Cheers,
Bernie.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise