Skip to content

Commit 39cf186

Browse files
committed
tyck: Add note about constraints on type instantiations
1 parent 6c5bfe6 commit 39cf186

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

typecheck/src/generics/constraint_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
//! type instantiations will not have any constraints, as they do not perform any
55
//! function calls in their declarations. As a consequence, only function calls
66
//! will be considered for all examples in this module.
7+
// FIXME: Actually, type instantiations can have constraints, because type definitions
8+
// can contain default fields which can be instantiated from a generic type's field, w/
9+
// structural typing
10+
// e.g.
11+
//
12+
// ```rust
13+
// type HasDefault[T](foo: T.make_foo())
14+
// ```
715

816
use std::collections::HashMap;
917

0 commit comments

Comments
 (0)