Custom Query (6619 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (28 - 30 of 6619)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ticket Resolution Summary Owner Reporter
#1435 invalid "Naughty" register error in Cmm Michael D. Adams
Description

When experimenting with Cmm code, I found the following bug/trap.

This Cmm code,

foo {
    bits8 x;
    x = 5;
    bits8[12] = x;
    R1 = x;
    jump bar;
}

causes the following error

/tmp/ghc6613_0/ghc6613_0.s: Assembler messages:

/tmp/ghc6613_0/ghc6613_0.s:7:0:
     Error: junk `naughty I386 byte register' after expression

The assembly that is produced is:

.text
        .align 4,0x90
.globl foo
foo:
        movl $5,%eax
        movb %al,12
        movb %al,very naughty I386 byte register
        jmp bar

.section .note.GNU-stack,"",@progbits
.ident "GHC 6.7.20070612"

Note the "very naughty I386 byte register" in there.

I am not sure whether this kind of Cmm can be generated from Haskell code.

#7989 fixed "No constructor has all these fields" message can be improved akio
Description

When a record update syntax contains fields from multiple constructors, you get an error message like this:

module Foo where

data A = A {a0, a1 :: Int}
data B = B {b0, b1 :: Int}

f x = x { a0 = 3, a1 = 2, b0 = 4, b1 = 5 }
datacon.hs:6:7:
    No constructor has all these fields: `a0', `a1', `b0', `b1'
    In the expression: x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}
    In an equation for `f': f x = x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}

However, this message becomes rather unhelpful when you are updating many (say 100) fields at once, because it doesn't say which field is causing the problem. I think it would be better if it only listed two conflicting field names like:

    No constructor has these two fields: `a0', `b0'
#6015 fixed "No instance" when using PolyKinds/DataKinds/FunDeps/Undecidable atnnn
Description

Consider this GHCi session:

> value (Proxy :: Proxy (Just True))
No instance for (Value (Maybe Bool) (Just Bool 'True) t0)
> :i Value
instance Value Bool 'True Bool
instance Value k a t => Value (Maybe k) (Just k a) (Maybe t)
> value (Proxy :: Proxy (Just True)) :: Maybe Bool
Just True

It would be helpful if GHC could use the instance (which seems suitable) or emit a better error message.

{-# LANGUAGE DataKinds, MultiParamTypeClasses, FunctionalDependencies,
             PolyKinds, UndecidableInstances, ScopedTypeVariables #-}

data Proxy a = Proxy
class Value a t | a -> t where value :: Proxy a -> t
instance Value True Bool where value _ = True
instance Value a t => Value (Just a) (Maybe t)
    where value _ = Just (value (Proxy :: Proxy a))

-- main = print (value (Proxy :: Proxy (Just True)))
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Note: See TracQuery for help on using queries.