on master help sign in
Rename Mismatch to BadExpr
d7e3cd7Evan Czaplicki
src/Reporting/Error/Type.hs+6−6
@@ -38,7 +38,7 @@ import qualified Type.Error as T
38
38
39
39
40data Error
40data Error
41− = Mismatch R.Region Category T.Type (Expected T.Type)
41+ = BadExpr R.Region Category T.Type (Expected T.Type)
42 | BadPattern R.Region PCategory T.Type (PExpected T.Type)
42 | BadPattern R.Region PCategory T.Type (PExpected T.Type)
43 | InfiniteType T.Type
43 | InfiniteType T.Type
44
44
@@ -164,8 +164,8 @@ ptypeReplace expectation tipe =
164toReport :: Code.Source -> T.Localizer -> Error -> Report.Report
164toReport :: Code.Source -> T.Localizer -> Error -> Report.Report
165toReport source localizer err =
165toReport source localizer err =
166 case err of
166 case err of
167− Mismatch region category actualType expected ->
167+ BadExpr region category actualType expected ->
168− toMismatchReport source localizer region category actualType expected
168+ toExprReport source localizer region category actualType expected
169
169
170 BadPattern region category tipe expected ->
170 BadPattern region category tipe expected ->
171 error "TODO" region category tipe expected
171 error "TODO" region category tipe expected
@@ -207,11 +207,11 @@ toDescription category thatThingIs =
207
207
208
208
209
209
210−-- TO MISMATCH REPORT
210+-- TO EXPR REPORT
211
211
212
212
213−toMismatchReport :: Code.Source -> T.Localizer -> R.Region -> Category -> T.Type -> Expected T.Type -> Report.Report
213+toExprReport :: Code.Source -> T.Localizer -> R.Region -> Category -> T.Type -> Expected T.Type -> Report.Report
214−toMismatchReport source localizer exprRegion category tipe expected =
214+toExprReport source localizer exprRegion category tipe expected =
215 Report.Report "TYPE MISMATCH" exprRegion [] $
215 Report.Report "TYPE MISMATCH" exprRegion [] $
216 case expected of
216 case expected of
217 NoExpectation expectedType ->
217 NoExpectation expectedType ->
src/Type/Solve.hs+3−3
@@ -89,7 +89,7 @@ solve env rank pools state constraint =
89 Unify.Err vars actualType expectedType ->
89 Unify.Err vars actualType expectedType ->
90 do introduce rank pools vars
90 do introduce rank pools vars
91 return $ addError state $
91 return $ addError state $
92− Error.Mismatch region category actualType $
92+ Error.BadExpr region category actualType $
93 Error.typeReplace expectation expectedType
93 Error.typeReplace expectation expectedType
94
94
95 CLocal region name expectation ->
95 CLocal region name expectation ->
@@ -104,7 +104,7 @@ solve env rank pools state constraint =
104 Unify.Err vars actualType expectedType ->
104 Unify.Err vars actualType expectedType ->
105 do introduce rank pools vars
105 do introduce rank pools vars
106 return $ addError state $
106 return $ addError state $
107− Error.Mismatch region (Error.Local name) actualType $
107+ Error.BadExpr region (Error.Local name) actualType $
108 Error.typeReplace expectation expectedType
108 Error.typeReplace expectation expectedType
109
109
110 CForeign region name (Can.Forall freeVars srcType) expectation ->
110 CForeign region name (Can.Forall freeVars srcType) expectation ->
@@ -119,7 +119,7 @@ solve env rank pools state constraint =
119 Unify.Err vars actualType expectedType ->
119 Unify.Err vars actualType expectedType ->
120 do introduce rank pools vars
120 do introduce rank pools vars
121 return $ addError state $
121 return $ addError state $
122− Error.Mismatch region (Error.Foreign name) actualType $
122+ Error.BadExpr region (Error.Foreign name) actualType $
123 Error.typeReplace expectation expectedType
123 Error.typeReplace expectation expectedType
124
124
125 CPattern region category tipe expectation ->
125 CPattern region category tipe expectation ->