Skip to content

Fix stack overflow when model properties reference itself#2375

Merged
timotheeguerin merged 10 commits into
microsoft:mainfrom
timotheeguerin:fix/circular-prop
Sep 7, 2023
Merged

Fix stack overflow when model properties reference itself#2375
timotheeguerin merged 10 commits into
microsoft:mainfrom
timotheeguerin:fix/circular-prop

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

fix #1741

@github-actions

github-actions Bot commented Sep 6, 2023

Copy link
Copy Markdown
Contributor

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
default: paramMessage`Alias type '${"typeName"}' recursively references itself.`,
},
},
"circular-prop": {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@timotheeguerin
timotheeguerin deleted the fix/circular-prop branch March 4, 2025 18:33
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