From a65f5b4cdb914aab3ca354a2cb44d85fab8e88dd Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Mon, 30 Sep 2024 13:45:24 +0200 Subject: [PATCH] tyck: Add note about constraints on type instantiations --- typecheck/src/generics/constraint_builder.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/typecheck/src/generics/constraint_builder.rs b/typecheck/src/generics/constraint_builder.rs index b25c9c1e..2d7c8714 100644 --- a/typecheck/src/generics/constraint_builder.rs +++ b/typecheck/src/generics/constraint_builder.rs @@ -4,6 +4,14 @@ //! type instantiations will not have any constraints, as they do not perform any //! function calls in their declarations. As a consequence, only function calls //! will be considered for all examples in this module. +// FIXME: Actually, type instantiations can have constraints, because type definitions +// can contain default fields which can be instantiated from a generic type's field, w/ +// structural typing +// e.g. +// +// ```rust +// type HasDefault[T](foo: T.make_foo()) +// ``` use std::collections::HashMap;