Ver código fonte

Forbid virtual methods with compile-time parameters in the design (#5365)

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
josh11b 1 ano atrás
pai
commit
e52b51e66a
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      docs/design/classes.md

+ 5 - 1
docs/design/classes.md

@@ -1199,7 +1199,11 @@ Interface methods may be implemented using virtual methods when the
 those methods by way of the interface will do virtual dispatch just like a
 direct call to the method does.
 
-[Class functions](#class-functions) may not be declared virtual.
+[Class functions](#class-functions) may not be declared virtual. Neither may
+functions with [compile-time parameters](/docs/design/generics/overview.md),
+whether those are `template` or checked, explicit or deduced. Compile-time
+parameters on the enclosing scope are allowed, though, so generic classes may
+have virtual methods.
 
 ##### Virtual modifier keywords