Skip to content

Commit

Permalink
Refactoring the global object initialization checker (#17996)
Browse files Browse the repository at this point in the history
This PR refactors the global object initialization checker as
implemented in
`compiler/src/dotty/tools/dotc/transform/init/Objects.scala` with the
following:

1. Refactoring the type hierarchy for abstract values by adding a new
base class `ValueElement` which has `Cold` and `Ref` as child classes.
This separates the first-order abstract values (`Cold` and `Ref`) from
second-order abstract values (`Refset`)
2. Adding documentation for the data structures and abstract syntax used
in the initialization checker
3. Adding return handlers which removes the warning for return
statements in secondary constructors, which is shown in
`tests/init-global/pos/secondary-constructor-return.scala`
  • Loading branch information
olhotak committed Jul 29, 2023
2 parents b9b1314 + ed00aaa commit a73316a
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 72 deletions.
Loading

0 comments on commit a73316a

Please sign in to comment.