Skip to content

DO NOT merge: integrate fuzzing fixes #4489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 23 commits into from

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented May 8, 2018

This branch contains fixes for fuzzing bugs discovered by @alexknvl — I put it together for retesting them and/or running the fuzzer again.

Blaisorblade and others added 23 commits May 3, 2018 17:11
```
Exception in thread "main" java.lang.AssertionError: assertion failed: position error: position not set for Ident(<error>) # 24
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:36)
	at dotty.tools.dotc.ast.Positioned.check$1(Positioned.scala:178)
	at dotty.tools.dotc.ast.Positioned.check$5$$anonfun$4(Positioned.scala:203)
```
This reverts commit 0f7b1b0 but keeps the
testcase.
Deep findMember recursions can happen as a recult of illegal cyclic structures.
I don't think there's a complete way to avoid these structures before the cyclic search
can happen. So we now detect it by imposing a recursion limit (configurable, by default 100).
…ersected types

Test every template and every type intersection for cycles in its members.
The tests are done as early possible without causing spurious cycles,
which for intersections means PostTyper, unfortunately.
Still missing: Do the test also for members reachable in common value definitions.
Detect more cyclic references be generalizing the condition which prefixes
are interesting.
 - Move them all to TypeErrors.scala
 - Systematically use `toMessage` for reporting
 - Catch stack overflows instead of counting recursions
Not needed here, but I missed the functionality elsewhere.
Once we are at it, let's try to bullet-proof everything.
Move it from `transformNode` to `goNamed` and `goUnnamed`. This might be faster
since that way `transformNode` should be an inline candidate since it is short.
This patch addressed the problem at a better point I think: to typecheck
```scala
class Foo extends someTree
```
we need to detect correctly if `someTree` should be typechecked as a term or a
type; `Int => 1` should be typechecked as a type, even though it looks like a
term according to `isTerm`.

Really, we shouldn't use isType at all, because the user might write a type in
place of a term or viceversa. I think we only want to know this is a constructor
call or a type; and maybe we should just let the parser tell us which, since it
knows.
Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Commit Messages

We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).

Please stick to these guidelines for commit messages:

  1. Separate subject from body with a blank line
  2. When fixing an issue, start your commit message with Fix #<ISSUE-NBR>:
  3. Limit the subject line to 72 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line ("Add" instead of "Added")
  7. Wrap the body at 80 characters
  8. Use the body to explain what and why vs. how

adapted from https://chris.beams.io/posts/git-commit

Have an awesome day! ☀️

@Blaisorblade
Copy link
Contributor Author

Closing as this branch is stale and most underlying PRs have progressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants