Skip to content

Missing cast in string interpolation #3464

Description

@ds5678

Input code

public string ContainsCast(int i)
{
	return $"a_{(short)i}_b";
}

public string ContainsCast(long i)
{
	return $"a_{(int)i}_b";
}

Erroneous output

public string ContainsCast(int i)
{
	return $"a_{(short)i}_b";
}

public string ContainsCast(long i)
{
	return $"a_{i}_b";
}

The absence of the cast in the second method is a behavioral change, and the problem only exhibits on the "Roslyn Latest" unit tests.

Details

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDecompilerThe decompiler engine itself

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions