@string in constructor -?

pg. 38

data class Question(@StringRes val textRedId: Int, val answer: Boolean)

what rule would allow one to conclude that adding the @StringRes in front of the variable would work in a constructor.

Thanks in advance.

@StringRes is an annotation that tells the compiler to expect the int textResId to be a reference to a string resource like R.string.correct_toast. Where correct_toast is defined in your strings file. See the docs.