Skip to content

Add tests for Function object canonicalization  #1120

@iarkh

Description

@iarkh

Function object canonicalization (which is what we can observe with identical on the value of constant expressions) is a completely new topic, and Function object canonicalization is the corresponding Spec update.

We'd need some tests for this update (not involving constructor tearoffs).

However, the topics will also overlap (such that canonicalization and constructor tearoffs occur together). For instance, the constructor tearoff feature includes support for explicit instantiation (like f<int> where f is a generic function), and constructor tearoffs themselves are subject to canonicalization (so identical(C.new, C.new) is true, and so is identical(GenericClass.new, GenericClass.new)`).

A closely related topic is function object equality (observed with operator ==). That's addressed in #1712. We don't have a Spec update for this, yet, and no implementation issues, so this is just 'For Your Information'. We'll return to function object equality when the language team has agreed on what to do.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions