Skip to content

68 Type declaration references ​

Task.class is a typed Class<Task> descriptor for the declaration. Its metadata tells us the type name and whether it has value semantics.

norm
class Task { String title }

main() {
  Class<Task> type = Task.class
  printLine(type.name())
  printLine(type.isValue())
}

Expected output:

text
Task
false

Try it: Replace Task.class with String.class and compare the metadata.

Precise rules: Reference.

Norm 0.25