krfkeith / silver

Automatically exported from code.google.com/p/silver
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Refactor uses of errorType #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Provide an explanation of what the project should entail:

errorType() is used in two different ways throughout silver:

1. To get a fresh type variable in places where no "error" has occurred at all!
2. Places where a type is needed but an error precludes getting one.

This project is to created a second, totally identical function called 
'freshType' or similar, and to find each and every use of errorType, and decide 
whether it should stay errorType, or be renamed to freshType.

Provide a concrete example of a problem this project will fix:

In the future we might wish to clean up some error reporting. Many errors cause 
several error messages to be emitted, and if we actually had a real type used 
to represent "an error occurred," then we could avoid producing spurious, 
duplicate messages.

Partitioning out fresh from error would mean we can make errorType produce... 
well, an error type.

Provide a short guide on how to start this project:

First, duplicate errorType in silver:definition:type TypeExp.sv

then...

grep -R errorType grammars/ | cut -d: -f1 | xargs gedit

Provide a very rough and probably inaccurate expectation of what the set of 
patches completing this project would look like:

Just one: add the function and change some uses of error to fresh.

Probable challenges in completing this project:

It may sometimes be slightly difficult to determine which is correct! Try to 
understand what the code is doing in each and every case.

Additional Information:

Should be a pretty small job, but taking the time to figure out what's going on 
in each place it is used should give a decent cross-section of the compiler.

Original issue reported on code.google.com by tux...@gmail.com on 10 Jan 2012 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by kevin.ar...@gmail.com on 16 Jan 2012 at 4:02

GoogleCodeExporter commented 9 years ago

Original comment by kevin.ar...@gmail.com on 16 Jan 2012 at 7:11

GoogleCodeExporter commented 9 years ago

Original comment by kevin.ar...@gmail.com on 16 Jan 2012 at 9:20

GoogleCodeExporter commented 9 years ago
Fixed in d79a2769fdcf

Original comment by kevin.ar...@gmail.com on 16 Jan 2012 at 10:35