Permalink
Browse files

[common] Implement type_check and publish a type cache in NQPClassHOW.

  • Loading branch information...
1 parent 346bb02 commit e2fc32fd0813cb0289b08ccd5ec6fdbcccd2016a @jnthn committed Nov 13, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 common/NQP/NQPSetting.pm
@@ -496,6 +496,9 @@ my knowhow NQPClassHOW {
# Incorporate any new multi candidates (needs MRO built).
self.incorporate_multi_candidates($obj);
+
+ # Publish type cache.
+ self.publish_type_cache($obj);
# XXX TODO: Compose attributes.
@@ -579,6 +582,11 @@ my knowhow NQPClassHOW {
@mro;
}
+ method publish_type_cache($obj) {
+ # XXX TODO: when we have roles, need these here too.
+ nqp::publish_type_check_cache($obj, @!mro)
+ }
+
##
## Introspecty
##
@@ -619,6 +627,14 @@ my knowhow NQPClassHOW {
0;
}
+ method does($obj, $checkee) {
+ 0 # XXX TODO
+ }
+
+ method type_check($obj, $checkee) {
+ self.isa($obj, $checkee) || self.does($obj, $checkee)
+ }
+
##
## Dispatchy
##

0 comments on commit e2fc32f

Please sign in to comment.