AnyDSL / thorin

The Higher-Order Intermediate Representation
https://anydsl.github.io
GNU Lesser General Public License v3.0
151 stars 15 forks source link

fix math op result type deduction mismatches #113

Closed michael-kenzel closed 3 years ago

michael-kenzel commented 3 years ago

The return types of half_float:: math functions are a mix of half and expr. As a result, return type deduction for the lambda in line 962 fails due to mismatching types across the various return statements. Returning half_float::expr from one of the other lambdas results in errors due to half_float::expr not being convertible to Box when the result is later used to initialize a literal, e.g., in line 839. This attempts to fix these issues by explicitly specifying a return type for the lambdas in question.

madmann91 commented 3 years ago

Looks good! Not sure why gcc doesn't report an error there.