Skip to content

Unsoundness in the Reflection Typed #12222

Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.0.0-RC3

Issue

Typed assumes that it is typing a Term but it might also be a pattern.

Solution 1

Make Typed contain a Tree.

This is a simple change at the definition site, but it has an impact at the use site.
For all Typed that are terms we would need to do:

-  case Typed(expr, tpt) =>
+  case Typed(expr: Term, tpt) =>

Solution 2

Create an alternative type such as TypedTree which handles the cases where the expr is not a Term.

There might be a subtyping relationship Typed <:< TypedTree.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions