I haven't bothered to implement "sealed". What would one due with it besides lock down the system String class? I mean, I know technically what it does, but I've never needed it in any project.
Generic method constraints use the syntax "where X must be Y" so knowing that I did a search:
659 ~/Projects/Cobra/Workspace-New $ gco where | grep must
./HowTo/220-UseDynamicTyping.cobra:51: # - more brittle (to change program to `float` you must find and replace everywhere)
./HowTo/310-IterateThroughRecursiveDataWithYield.cobra:14: where T must be IComparable<of T>
./HowTo/310-IterateThroughRecursiveDataWithYield.cobra:55: where T must be IComparable<of T>
./SamplesInProgress/WebSearcher.cobra:33: where TSearchResult must be SearchResult
./Source/Container.cobra:49: where TMember must be class, IMember
./Source/SharpGenerator.cobra:1274: # could it be a subclass? no. value types are structs and cannot be subclassed so this must be `if i` where `i` is nullable struct
./Source/SharpGenerator.cobra:1428: # could it be a subclass? no. value types are structs and cannot be subclassed so this must be `if i` where `i` is nullable struct
./Tests/240-generics/300-declare-generic-classes/110-generic-class-inheritance-and-more.cobra:4: where T must be IA
./Tests/240-generics/300-declare-generic-classes/130-constructed-class-inheritance-with-for-loop-inference.cobra:18: where T must be IProcessor
./Tests/240-generics/300-declare-generic-classes/600-generic-class-with-type-constraint.cobra:2: where TBar must be Bar
./Tests/240-generics/300-declare-generic-classes/602-instantiate-generic-arg.cobra:2: where TArg must be class, callable
./Tests/240-generics/300-declare-generic-classes/602-instantiate-generic-arg.cobra:13: where TBaz must be Baz, callable
./Tests/240-generics/300-declare-generic-classes/602-instantiate-generic-arg.cobra:30: where TInter must be Inter
./Tests/240-generics/300-declare-generic-classes/610-generic-type-compatibility.cobra:5: where T must be IComparable<of T>
./Tests/240-generics/300-declare-generic-classes/610-generic-type-compatibility.cobra:33: where T must be IComparable<of T>
./Tests/240-generics/300-declare-generic-classes/800-generic-twister.cobra:11: where T must be IAMember
... so publicly see
How To: IterateThroughRecursiveDataWithYield.
If you have the workspace there are some additional files above.
The general syntax is:
where <generic-param> must be <constraints>
<constraints> := <constraint> [, <constraint>]*
<constraint> := class | struct | callable | <type>
-Chuck