#3876: assignement of thrown extension to variable of type string
---------------------------------+------------------------------------------
    Reporter:  andrewufrank      |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  6.10.4      
    Keywords:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Testcase:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
Description changed by igloo:

Old description:

> in an unusual case (exception thrown in code in the return) the thrown
> exception is returned from the function and then assigned to a variable
> with another type (e.g. string); if the variable is later evaluated, the
> exception is then actually thrown there (and not in the original
> function).
>
> the bug is the problem in the asignement of a thrown exception to another
> type. the coding style is unfortunate and not encourage, but the compiler
> should report an error.
>
> (code like
>              = do ...
>                 return (case x of
>                            0 -> throw Anexception
>                         )
> produces the error.
>

>

> i attach a file to demonstrate the problem.

New description:

 in an unusual case (exception thrown in code in the return) the thrown
 exception is returned from the function and then assigned to a variable
 with another type (e.g. string); if the variable is later evaluated, the
 exception is then actually thrown there (and not in the original
 function).

 the bug is the problem in the asignement of a thrown exception to another
 type. the coding style is unfortunate and not encourage, but the compiler
 should report an error.
 (code like
 {{{
              = do ...
                 return (case x of
                            0 -> throw Anexception
                         )
 }}}
 produces the error.

 i attach a file to demonstrate the problem.

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3876#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to