Dominaezzz / kgl

Thin multiplatform wrappers for graphics.
Apache License 2.0
106 stars 14 forks source link

Can't compile with version kgl-opengl 0.1.9-dev-6, compiler crash #15

Closed nlbuescher closed 4 years ago

nlbuescher commented 4 years ago

Will have to test more in isolation (mini project), but there seems to be an issue somewhere with the conversion from Boolean to UByte. Code works fine with kgl-opengl 0.1.9-dev-5 (ie before the addition of nice_opengl changes.

e: Compilation failed: actual type is kotlin.Boolean, expected kotlin.UByte

 * Source files: 
 * Compiler version info: Konan: 1.3.61 / Kotlin: 1.3.60
 * Output kind: PROGRAM

e: java.lang.IllegalStateException: actual type is kotlin.Boolean, expected kotlin.UByte
e: Compilation failed: actual type is kotlin.Boolean, expected kotlin.UByte

    at org.jetbrains.kotlin.backend.konan.BoxingKt.getTypeConversionImpl(Boxing.kt:40)
    at org.jetbrains.kotlin.backend.konan.BoxingKt.getTypeConversion(Boxing.kt:28)
    at org.jetbrains.kotlin.backend.konan.lower.AutoboxingTransformer.adaptIfNecessary(Autoboxing.kt:161)
    at org.jetbrains.kotlin.backend.konan.lower.AutoboxingTransformer.useAs(Autoboxing.kt:125)
    at org.jetbrains.kotlin.backend.konan.lower.AutoboxingTransformer.visitCall(Autoboxing.kt:200)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:170)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:89)
    at org.jetbrains.kotlin.ir.expressions.IrExpression$DefaultImpls.transform(IrExpression.kt:28)
    at org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase.transform(IrExpressionBase.kt:24)
    at org.jetbrains.kotlin.ir.expressions.impl.IrCallWithIndexedArgumentsBase.transformChildren(IrCallWithIndexedArgumentsBase.kt:70)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.backend.common.AbstractValueUsageTransformer.visitFunctionAccess(AbstractValueUsageTransformer.kt:91)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:169)
    at org.jetbrains.kotlin.backend.konan.lower.AutoboxingTransformer.visitCall(Autoboxing.kt:205)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:170)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:89)
    at org.jetbrains.kotlin.ir.expressions.IrExpression$DefaultImpls.transform(IrExpression.kt:28)
    at org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBase.transform(IrExpressionBase.kt:24)
    at org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.transformChildren(IrVariableImpl.kt:93)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.backend.common.AbstractValueUsageTransformer.visitVariable(AbstractValueUsageTransformer.kt:174)
    at org.jetbrains.kotlin.backend.common.AbstractValueUsageTransformer.visitVariable(AbstractValueUsageTransformer.kt:32)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitVariable(IrElementTransformerVoid.kt:85)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitVariable(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl.accept(IrVariableImpl.kt:86)
    at org.jetbrains.kotlin.ir.declarations.IrDeclaration$DefaultImpls.transform(IrDeclaration.kt:42)
    at org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.transform(IrDeclarationBase.kt:27)
    at org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.transformChildren(IrBlockBodyImpl.kt:49)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.backend.common.AbstractValueUsageTransformer.visitBlockBody(AbstractValueUsageTransformer.kt:107)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:97)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.accept(IrBlockBodyImpl.kt:40)
    at org.jetbrains.kotlin.ir.expressions.IrBody$DefaultImpls.transform(IrBody.kt:24)
    at org.jetbrains.kotlin.ir.expressions.IrBlockBody$DefaultImpls.transform(IrBody.kt)
    at org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl.transform(IrBlockBodyImpl.kt:26)
    at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionBase.transformChildren(IrFunctionBase.kt:77)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.backend.common.AbstractValueUsageTransformer.visitFunction(AbstractValueUsageTransformer.kt:248)
    at org.jetbrains.kotlin.backend.konan.lower.AutoboxingTransformer.visitFunction(Autoboxing.kt:77)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:55)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:56)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.accept(IrFunctionImpl.kt:90)
    at org.jetbrains.kotlin.ir.declarations.IrDeclaration$DefaultImpls.transform(IrDeclaration.kt:42)
    at org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.transform(IrDeclarationBase.kt:27)
    at org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl.transformChildren(IrClassImpl.kt:100)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildrenVoid(IrElementTransformerVoid.kt:280)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.transformChildren(IrElementTransformerVoid.kt:25)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitDeclaration(IrElementTransformerVoid.kt:46)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.kt:49)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.kt:50)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitClass(IrElementTransformerVoid.kt:24)
    at org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl.accept(IrClassImpl.kt:89)
    at org.jetbrains.kotlin.ir.declarations.IrDeclaration$DefaultImpls.transform(IrDeclaration.kt:42)
    at org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.transform(IrDeclarationBase.kt:27)
    at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.transformChildren(IrFileImpl.kt:71)
    at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:285)
    at org.jetbrains.kotlin.backend.konan.lower.Autoboxing.lower(Autoboxing.kt:48)
    at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$makeIrFilePhase$1.invoke(PhaseBuilders.kt:173)
    at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$makeIrFilePhase$1.invoke(PhaseBuilders.kt:171)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)
    at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$performByIrFile$1.invoke(PhaseBuilders.kt:144)
    at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$performByIrFile$1.invoke(PhaseBuilders.kt:136)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$dependenciesLowerPhase$1.invoke(ToplevelPhases.kt:319)
    at org.jetbrains.kotlin.backend.konan.ToplevelPhasesKt$dependenciesLowerPhase$1.invoke(ToplevelPhases.kt:305)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:28)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:128)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:24)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:127)
    at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:105)
    at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:42)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:27)
    at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:74)
    at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:34)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:82)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:50)
    at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:215)
    at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:207)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:225)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:222)
    at org.jetbrains.kotlin.util.UtilKt.profileIf(Util.kt:27)
    at org.jetbrains.kotlin.util.UtilKt.profile(Util.kt:21)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:224)
    at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:304)
    at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:16)
Dominaezzz commented 4 years ago

glIsEnabled() now returns Boolean. If you were using kotlin-imgui then that's why it's broken, because I made breaking changes. I'll publish an update to kotlin-imgui this evening or tomorrow (Sunday).

Dominaezzz commented 4 years ago

Also, functions that used to accept GLboolean (which was UByte I think) now accept Boolean.

nlbuescher commented 4 years ago

That explains it. Thanks!