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 stack overflow when model properties reference itself #2375

Merged
merged 10 commits into from
Sep 7, 2023

Conversation

timotheeguerin
Copy link
Member

fix #1741

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status):
Playground: https://cadlplayground.z22.web.core.windows.net/prs/2375/

Website: https://cadlwebsite.z1.web.core.windows.net/prs/2375/

Microsoft Auto Changeset Bot and others added 2 commits September 6, 2023 08:32
@@ -811,6 +811,12 @@ const diagnostics = {
default: paramMessage`Alias type '${"typeName"}' recursively references itself.`,
},
},
"circular-prop": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it be circular-property-reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

I kept the same naming style as the other circular reference errors

 },
  "circular-base-type": {
    severity: "error",
    messages: {
      default: paramMessage`Type '${"typeName"}' recursively references itself as a base type.`,
    },
  },
  "circular-op-signature": {
    severity: "error",
    messages: {
      default: paramMessage`Operation '${"typeName"}' recursively references itself.`,
    },
  },
  "circular-alias-type": {
    severity: "error",
    messages: {
      default: paramMessage`Alias type '${"typeName"}' recursively references itself.`,
    },
  },

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, cool

@timotheeguerin timotheeguerin enabled auto-merge (squash) September 7, 2023 17:29
@timotheeguerin timotheeguerin merged commit 46a0a0a into microsoft:main Sep 7, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circular reference cause stack overflow issue
3 participants