From 939be44ca23476e622dfb24a592383fe2a1da61f Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 26 Oct 2022 08:32:24 -0700 Subject: Auto synthesis of Differential type (#2466) --- source/slang/diff.meta.slang | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/diff.meta.slang') diff --git a/source/slang/diff.meta.slang b/source/slang/diff.meta.slang index 26fec224c..f314e0487 100644 --- a/source/slang/diff.meta.slang +++ b/source/slang/diff.meta.slang @@ -18,6 +18,10 @@ attribute_syntax [__custom_jvp(function)] : CustomJVPAttribute; __magic_type(DifferentiableType) interface IDifferentiable { + // Note: the compiler implementation requires the `Differential` associated type to be defined + // before anything else. + + [__BuiltinAssociatedTypeRequirementAttribute(_BuiltinAssociatedTypeRequirementKind.Differential)] associatedtype Differential; static Differential zero(); -- cgit v1.2.3