"Cannot convert from float to float"
Posted: Sun May 02, 2010 11:42 pm
I encountered this error while working on the same roguelike library project from before. Here's the bit of code:
I get the error "Main.cobra(294): error: Argument "8": cannot convert from "float" to "float"" and the same error for argument 8. After a bit of experimentation, I resolved the issue, which was that the library call wanted a Float32 type. Changing my last two arguments to 1.0_f32 and 0.75_f32 allow it to compile.
I just wanted to suggest that if the error message could be made more explicit, that would be groovy.
- Code: Select all
.offConsole.blit(0, 0, .sampleScreenWidth // 2, .sampleScreenHeight // 2, .sampleConsole, off_x, off_y, 1.0f, 0.75f)
I get the error "Main.cobra(294): error: Argument "8": cannot convert from "float" to "float"" and the same error for argument 8. After a bit of experimentation, I resolved the issue, which was that the library call wanted a Float32 type. Changing my last two arguments to 1.0_f32 and 0.75_f32 allow it to compile.
I just wanted to suggest that if the error message could be made more explicit, that would be groovy.