#5892: Compiler crash and other oddities when using RecordWildCards with record
accessors not imported
------------------------------------------------+---------------------------
Reporter: parcs | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.4.1
Resolution: fixed | Keywords:
Os: Unknown/Multiple | Architecture:
Unknown/Multiple
Failure: Compile-time crash | Difficulty: Unknown
Testcase: rename/should_fail/T5892a, T5892b | Blockedby:
Blocking: | Related:
------------------------------------------------+---------------------------
Changes (by simonpj):
* status: new => closed
* difficulty: => Unknown
* resolution: => fixed
* testcase: => rename/should_fail/T5892a, T5892b
Comment:
Good point. I've fixed the compiler bug.
I looked in [http://www.haskell.org/ghc/docs/latest/html/users_guide
/syntax-extns.html#record-wildcards the documentation] and it seems clear
enough that the ".." expands only to the ''in-scope'' fields. So for
example in your code
{{{
import Data.Tree (Tree(Node))
foo = let rootLabel = (); subForest = [] in Node{..}
}}}
since there are ''no'' in-scope fields, this behaves just as if you'd said
{{{
import Data.Tree (Tree(Node))
foo = let rootLabel = (); subForest = [] in Node{}
}}}
And I think the implementation faithfully does that.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5892#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs