Synopsis A question about a Rascal type.
  • QType OptName : TypeDescriptor
  • QType OptName : QSteps Test Listing
Description A type question presents a Rascal expressions and poses a question about its type.

OptName is an optional name of the question (enclosed between [ and ]). If OptName is missing, the question gets a unique number as name.

The desired type is given by a TypeDescriptor.

The first form presents the value generated for the TypeDescriptor and asks about its type.

The second form allows more preparatory steps and also allows adding a listing to the question.
Examples See the effect of the following type questions in the Questions section below.

Question 1

The following question can be paraphrased as: I give you an arbitrary set of integers, what is its type?
QType: <A:set[int]>

Question 2

The following question can be paraphrased as: I give you an addition of a set of integers, strings or reals and another set of the same type; what is the type of the result?
QType: <A:set[arb[int,str,real]]> + <B:same[A]>

Question [1].
The type of {8} is

Question [2].
The type of {4.25380863989438400, -7.63797727201163200, -15.319735647710994800, 11.26138528181219200, -9.88895333696056400} + {19.3936616079923600, 15.16730071489920400, 17.64996717928457600} is

Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit