Skip to content

Fix Call opcode in DuckTyping on struct targets.#1469

Merged
tonyredondo merged 2 commits into
masterfrom
tony/ducktype-struct-memberscall-fix
May 17, 2021
Merged

Fix Call opcode in DuckTyping on struct targets.#1469
tonyredondo merged 2 commits into
masterfrom
tony/ducktype-struct-memberscall-fix

Conversation

@tonyredondo

@tonyredondo tonyredondo commented May 16, 2021

Copy link
Copy Markdown
Member

This PR fixes methods and properties calls on DuckTyping over struct targets by changing the CallVirt to a Call opcode.

A strange behavior was observed on net461 in Release mode when using CallVirt opcode. With this fix the DuckType test suite passes in both Debug and Release.

This PR has been tested in all 8 pipelines available.

@DataDog/apm-dotnet

@tonyredondo tonyredondo self-assigned this May 16, 2021
@tonyredondo tonyredondo changed the title Ducktype struct members call fix Fix Call opcode in DuckTyping on struct targets. May 16, 2021
@tonyredondo
tonyredondo marked this pull request as ready for review May 16, 2021 19:04
@tonyredondo
tonyredondo requested a review from a team as a code owner May 16, 2021 19:04
@tonyredondo
tonyredondo requested a review from andrewlock May 16, 2021 19:07

@andrewlock andrewlock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for figuring this one out!

[DuckIgnore]
public string GetValue() => Value.ToString();

public abstract int GetAnswerToMeaningOfLife();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

😂

@tonyredondo
tonyredondo requested a review from a team May 17, 2021 08:11

@zacharycmontoya zacharycmontoya left a comment

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.

Good find!

@tonyredondo
tonyredondo merged commit 989753b into master May 17, 2021
@tonyredondo
tonyredondo deleted the tony/ducktype-struct-memberscall-fix branch May 17, 2021 17:56
@andrewlock andrewlock added this to the 1.27.0 milestone Jun 1, 2021
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.

4 participants