This works on Moar but fails on Parrot and JVM:

$ perl6-m -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" 
} }; class C does A { }; C.new.pub;'
OH HAI

$ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" 
} }; class C does A { }; C.new.pub;'
Cannot type check against type variable $?CLASS
  in any type_check at gen/parrot/Metamodel.nqp:297
  in block  at gen/parrot/CORE.setting:963
  in method BUILDALL at gen/parrot/CORE.setting:946
  in method bless at gen/parrot/CORE.setting:935
  in method new at gen/parrot/CORE.setting:920
  in method new at gen/parrot/CORE.setting:918
  in method priv at -e:1
  in method pub at -e:1
  in block <unit> at -e:1

$ perl6-j -e 'role A { method pub { self!priv }; method !priv () { say "OH HAI" 
} }; class C does A { }; C.new.pub;'
Cannot type check against type variable $?CLASS
  in any type_check at gen/jvm/Metamodel.nqp:297
  in block  at gen/jvm/CORE.setting:949
  in method BUILDALL at gen/jvm/CORE.setting:932
  in method bless at gen/jvm/CORE.setting:921
  in method new at gen/jvm/CORE.setting:905
  in method priv at -e:1
  in method pub at -e:1
  in block <unit> at -e:1

I added a test (skipped for Parrot and JVM) to S14-roles/basic.t with the 
following commit: https://github.com/perl6/roast/commit/8942c27ab2

Reply via email to