You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Better type name generation policy: (1) handle name clashes with existing types (e.g. struct names), (2) try not to show things like T423 to a customer, but rather reset the counter after type-checking a single statement — if possible.
Something like fn foo<D1, D2>(x: D1*D2) = 1 should yield a "missing Dim bound" constraint, because the type parameters are used type annotation dimension expression
Re-enable generics_unused_type_parameter
Equality on function types should be forbidden. Maybe we need to introduce an Eq type class.
try_trivial_resolution can easily analyze the constraint structure further to discard constraints like List<T0> ~ Bool, which will yield better error messages in return
Better error message for sth. like true(2)
Check if we can reduce the number of constraints: (1) by cancelling out equal constraints and (2) by not adding as many constraints. for example, in x + y, we need type(x) ~ type(y) and IsDim(type(x)), but we could potentially save the IsDim(type(y)). On the other hand, that would result in worse error messages.
For all (generic) functions that we have, check that we can (1) remove all type annotations and (2) get the same type or a more general type.
Add tests for type inference with partial annotations
Better error message for fn f<A: Dim>(x: A) -> A = 2x; f(true)
Improve error messages for callables, see function_types_in_argument_position test
see #443 for background information
fn f<A: Dim>(x: A) -> A * Velocity = x * c
does not work, givingA
a different name works fine.forall
multiple times #524T423
to a customer, but rather reset the counter after type-checking a single statement — if possible.fn foo<D1, D2>(x: D1*D2) = 1
should yield a "missing Dim bound" constraint, because the type parameters are used type annotation dimension expressiongenerics_unused_type_parameter
Eq
type class.try_trivial_resolution
can easily analyze the constraint structure further to discard constraints likeList<T0> ~ Bool
, which will yield better error messages in returntrue(2)
x + y
, we needtype(x) ~ type(y)
andIsDim(type(x))
, but we could potentially save theIsDim(type(y))
. On the other hand, that would result in worse error messages.fn f<A: Dim>(x: A) -> A = 2x; f(true)
function_types_in_argument_position
testinfo <function>
#491mean
,stddev
, etc in Numbatquadratic_equation
aList<B/A>
return type. #449The text was updated successfully, but these errors were encountered: