txt: ## typeobject.md
  class X::Does::TypeObject
  
  Error due to mixing into a type object
  
  ```raku
  class X::Does::TypeObject is Exception {}
  ```
  
  When you try to add one or more roles to a type object with `does` after it has been composed, an error of type `X::Does::TypeObject` is thrown:
  
  ```raku
  Mu does Numeric;    # Cannot use 'does' operator with a type object.
  
  ```
  
  The correct way to apply roles to a type is at declaration time:
  
  ```raku
  class GrassmannNumber does Numeric { ... };
  role AlgebraDebugger does IO { ... };
  grammar IntegralParser does AlgebraParser { ... };
  
  ```
  
  Roles may only be runtime-mixed into defined object instances:
  
  ```raku
  GrassmannNumber.new does AlgebraDebugger;
  
  ```
  
  (This restriction may be worked around by using [augment or supersede](/language/variables#The_augment_declarator), or with dark Metamodel magics, but this will likely result in a significant performance penalty.)
  
  # [Methods](#class_X::Does::TypeObject "go to top of document")[§](#Methods "direct link")
  
  ## [method type](#class_X::Does::TypeObject "go to top of document")[§](#method_type "direct link")
  
  ```raku
  method type(X::Does::TypeObject:D: --> Mu:U)
  ```
  
  Returns the type object into which the code tried to mix in a role.
  