Skip to content

in parameter #316

@sebastienros

Description

@sebastienros

On net6.0 only, with this class

    public class ParseException : Exception
    {
        public ParseException(string message, in TextPosition position) : base(message)
        {
            Position = position;
        }

        public TextPosition Position { get; set; }
    }

Try to create an instance like this:

Expression.Throw(Expression.New(typeof(ParseException).GetConstructors().First(), new [] { Expression.Constant("Message"), context.Position() } ))

Fails with a message similar to "invalid CLR ..." when invoking the lambda. Works fine when I remove the in marker in the arguments list. Works fine on netcoreapp3.1 and net5.0 in my tests.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions