Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type hint of static inline var being ignored #7132

Closed
kevinresol opened this issue Jun 6, 2018 · 3 comments
Closed

Type hint of static inline var being ignored #7132

kevinresol opened this issue Jun 6, 2018 · 3 comments
Assignees
Milestone

Comments

@kevinresol
Copy link
Contributor

static inline var GAME_TIME:Float = 20;
$type(GAME_TIME); // Int
@Simn Simn self-assigned this Jun 6, 2018
@Simn
Copy link
Member

Simn commented Jun 6, 2018

Whaaat...

@Simn Simn added this to the Release 4.0 milestone Jun 6, 2018
@Simn Simn closed this as completed in 12ef7f7 Jun 6, 2018
@Simn
Copy link
Member

Simn commented Jun 6, 2018

Fix wasn't good. There's already some code which tries to convert int to float, but it ends up with something insane like a TFloat being typed as Int...

@Simn Simn reopened this Jun 6, 2018
@Simn
Copy link
Member

Simn commented Jun 6, 2018

Actually that fix might still be good for the non-Int/Float case because we don't want to lose the field type in these situations either. But we definitely shouldn't have float constants that have integer types.

@Simn Simn closed this as completed in bcea7ec Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants