orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
41 stars 3 forks source link

Type inference fails on Ref(0) #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Procedure to Repeat:
1. Type check an Orc program that consists only of "Ref(0)"

Expected / Actual Results:
Expect the expression type to be inferred.
Actual result: "Inference failed; could not find a minimal type. Please add 
explicit type information."

Version and Platform:
SVN rev. 3093

Original issue reported on code.google.com by jthywissen on 16 Jul 2012 at 2:28

GoogleCodeExporter commented 9 years ago

Original comment by jthywissen on 20 Jul 2012 at 2:10

GoogleCodeExporter commented 9 years ago

Original comment by arthur.peters on 29 Nov 2012 at 8:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in r3124. The type checker has been enhanced to make an educated guess 
when type parameters are missing and no minimal type is available. It will 
guess the lower bound of the range, unless the lower bound is Bot, in which 
case it will guess the upper bound. This should suffice for simple cases, such 
as this one.

Original comment by dkitc...@gmail.com on 5 Dec 2012 at 9:42

GoogleCodeExporter commented 9 years ago
Note that the typechecker will also emit a warning when it makes such guesses, 
since this situation is technically ambiguous according to the inference 
algorithm, but it will no longer fail entirely.

Original comment by dkitc...@gmail.com on 5 Dec 2012 at 9:46