// Test interception of protected assignments by the "assign" method
proc bletch(prop, val)
{
// This will throw an AccessCheck since this is not a method call
self.(prop) = val;
}
class foo {
protected var a;
protected var b;
public proc bar(prop, val) {
// This will attempt to redirect the assignemnt
// to a non-method, which will fail
bletch(prop, val);
}
}
proc main()
{
var x = new foo();
try {
x.bar(b, 4);
}
catch (e) {
"Caught ", e, '\n';
}
}