Skip to content

Missing cast in string interpolation #3464

@ds5678

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

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