Skip to content
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

Fix compiler assert fail on circular type inference error (issue #1334) #1339

Merged
merged 1 commit into from
Nov 5, 2016

Conversation

jemc
Copy link
Member

@jemc jemc commented Oct 19, 2016

This PR fixes a compiler assert fail on circular type inference error.

Resolves #1334.

@@ -675,7 +675,7 @@ bool expr_reference(pass_opt_t* opt, ast_t** astp)

ast_t* type = ast_type(def);

if(is_typecheck_error(type))
if(is_typecheck_error(type) && (errors_get_count(opt->check.errors) > 0))
Copy link
Member

Choose a reason for hiding this comment

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

Is it really the best thing to do? In a code like this

actor Main
  new create(env: Env) =>
    let x = x.create()
    let y = y.create()

only the error for x is reported. Wouldn't it be better to remove that line entierely?

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I did this is because the approach of removing the line entirely made the error message for another badpony case a little worse: https://github.com/ponylang/ponyc/pull/1339/files#diff-6adc6b8a17f2bbfe51cbc0151f770ce5R263

However, I've updated the PR to use that approach - for now we can live with those consequences I think, and possibly try to improve that other error message in a separate PR.

@SeanTAllen
Copy link
Member

There's a release underway. Please rebase against master and verify your CHANGELOG entry is correctly appearing in the "unreleased" section.

@jemc jemc force-pushed the fix/1334-circular-type-infer branch from 551cb3f to c4c7e28 Compare October 22, 2016 00:27
@jemc
Copy link
Member Author

jemc commented Oct 22, 2016

This has been updated based on @Praetonus' feedback and rebased to use the latest changelog section.

@SeanTAllen
Copy link
Member

CHANGELOG changed due to 0.7.0 release, this probably needs to be rebased against master.

@SeanTAllen
Copy link
Member

@jemc can you rebase one more time?

@Praetonus ready to sign off on this?

@Praetonus
Copy link
Member

Yes, looks good to me.

@jemc jemc force-pushed the fix/1334-circular-type-infer branch from c4c7e28 to 05f92fd Compare November 5, 2016 20:50
@jemc
Copy link
Member Author

jemc commented Nov 5, 2016

It's now rebased, so I'm merging.

However, I removed the changelog entry from the PR because I'm going to use this as a guinea pig for the automated changelog process.

@jemc jemc force-pushed the fix/1334-circular-type-infer branch from 05f92fd to 5c27ca8 Compare November 5, 2016 20:53
@jemc jemc changed the title Fix compiler assert fail on circular type inference error. Fix compiler assert fail on circular type inference error (issue #1334) Nov 5, 2016
@jemc jemc added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Nov 5, 2016
@jemc jemc merged commit 9f0bb66 into master Nov 5, 2016
ponylang-main added a commit that referenced this pull request Nov 5, 2016
@jemc jemc deleted the fix/1334-circular-type-infer branch November 5, 2016 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type inference with circular dependency
3 participants