Type mismatch errors not showing

I for some reason can’t select the bug report category so i guess I’ll try here.

What i want to achieve

That it shows the type mismatch error when it should.

The issue
If i have code like the example below, i would expect it to show an error when i make the variable bar as it’s not a number but yet it does nothing.

type Foo = number;

local bar: Foo = "This is a string not a number, so where is the error then?"

As you can see in this screenshot there is no error.

Solutions i have tried so far

I have tried searching both google and dev forum to see if i can find a similar issue as this one, but i could not the only result that sounded like my issue was just a mistake in the type.

Recent

I used to do Luau a lot but i have been on a break, before i went on break there was no issues and everything worked as normal (about one month ago) but when i try to get it to work now that i need it, it just doesn’t. I really do not know why so any information will help.

Try adding

--!nonstrict

to the start and make sure your script isn’t disabled

So i assume this must be new then since i never had to do this before. Thanks

I think it is in studio settings but you can toggle it so it is --!strict or --!nonstrict instead of --!nocheck

So i did some digging and it appears that --!nonstrict is the default which doesn’t entirely make sense, it also doesn’t seam there is a way to choose the default

That seems so what I thought the setting was just a beta option making the default nonstrict but even with the beta enabled it seems that it doesn’t work

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.