Can't initialize DateTime

I’m using Elements .2545, .NET Standard library project, VS 2017.

If I try to create DateTime like this:

let dt = DateTime(2020, 8, 28, 8, 15, 30)

I get a compile error (E106) Type casts must have exactly 1 parameter.

If I revert back to .2525 the issue goes away.

What platform is this? Are you using Elements RTL?

it would be great if you could send a complete testcase project that shows this, to avoid ambiguities.

Sorry about that. Test project attached.

DateTimeInitTest.zip (19.9 KB)

That compiles fine for me?

import System.Collections.Generic
import System.Linq
import System.Text
import System.Threading.Tasks

public class Class1 {
    func test() {
        let dt = DateTime(2020, 8, 28, 8, 15, 30) // H11 Local variable "dt" is assigned to but never read
    }
}

I’m on 2546, but nothing changed there…

Possibly, but the screen below happens to me on .2545. If you can give me temporary beta access maybe I can try .2546?

We’ll have 2457 our later tonight. The odd thing is, that nothing really changed here, in the compiler, this week…

Ok, I’ll check .2547 and get back to you.

1 Like

It compiles fine with .2549. Thank you.

1 Like

Cool!