Closed wayland closed 3 years ago
hi @wayland - I tried this... with no Physics::Unit or Physics::Measure...
class Test {
has Real $.length;
has Real $.width;
method foo {
say $!length <=> $!width;
}
}
my $a = Test.new();
$a.foo();
It gives this error: Invocant of method 'Bridge' must be an object instance of type 'Real', not a type object of type 'Real'. Did you forget a '.new'?
So I am wondering whether is this a general raku issue - you are comparing 2 undefined objects after all.
I kinda prefer my error ... Cannot look up attributes in a Physics::Measure::Length type object
What specifically would you propose?
~p6steve
The error coming from the following would be more useful if it were to complain about the undefined value in some way; what I really want is a documented way to test if it's undefined like this. For the record, calling
defined($!height)
insidefoo()
also fails.HTH,