Darkyenus / glsl4idea

A GLSL language plugin for IntelliJ IDEA
GNU Lesser General Public License v3.0
101 stars 31 forks source link

Type compatibility checking #7

Open Darkyenus opened 10 years ago

AbigailBuccaneer commented 9 years ago

It looks like there's already a significant quantity of code dedicated to this - as well as boolean GLSLType#isConvertibleTo(GLSLType), there's also a mass of code in GLSLOperator dedicated to generating lists of all possible compatible types for each operator. Which I think is the wrong way to go about it - it answers the question "what types can this operator handle?", rather than "given that this operator has these operands, is that valid and if so what's the resultant type?"

I'm currently adding uint/double/uvec/dvec/dmat support to the language and extending the existing GLSLOperator code to support these will be very laborious. I'm going to leave it for now but I think that the majority of the code in GLSLOperator will need replacing.

Darkyenus commented 9 years ago

I am all for simplification, I don't think that we need to know all possibilities.

Darkyenus commented 9 years ago

This commented code may be related.