Why isn't the address of an object of a schema type an acceptable value for a pointer to the (undiscriminated) schema type? type sptr_type = ^ string ; type sptr_array_type( n : integer ) = array [ 1 .. n ] of sptr_type ; type sptr_array_ptr_type = ^ sptr_array_type ; const s1 = 's1' ; const s2 = 's2' ; const s3 = 's3' ; const slist : sptr_array_type(3) = ( @s1, @s2, @s3 ) ; var slist_ptr : sptr_array_ptr_type = @slist ; t12.pas:23: error: assignment from incompatible pointer type I got the same error when I changed "slist" (the object of the discriminated schema type) from a "const" to a "var". I got the same error when I tried using an assignment statement: var slp : sptr_array_ptr_type ; ... slp := @slist ; If a discriminated instance of a schema type isn't quite the same type as the undiscriminated type, then when would I ever be able to use the address of an object as a value for a pointer to the undiscriminated type? (without coercion, that is)
participants (3)
-
Jay Michael -
Prof A Olowofoyeku (The African Chief) -
Waldek Hebisch