Skip to content

Add fromInt method on doc_gen - #2091

Open
Geokureli wants to merge 4 commits into
openfl:developfrom
Geokureli:patch-1
Open

Add fromInt method on doc_gen#2091
Geokureli wants to merge 4 commits into
openfl:developfrom
Geokureli:patch-1

Conversation

@Geokureli

Copy link
Copy Markdown
Contributor

Flixel-doc was getting the following error on this line:

8,3,2/src/lime/_internal/backend/native/NativeOpenGLRenderContext.hx:1500: characters 26-33 : Abstract<lime.graphics.opengl.GLShader> has no field fromInt

I was gonna make an issue and fix later but I saw your new 12 part questionnaire to make a bug and decided I'll probably never ever want to go through that, especially for something like this that takes 2 sentences to properly convey.

Comment thread src/lime/graphics/opengl/GLShader.hx Outdated
Comment thread src/lime/graphics/opengl/GLShader.hx Outdated
return 0;
}

public static function fromSources(gl:Dynamic, source:String, type:Int):GLShader

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, I think fromSource should be fromSources so the doc signature matches the real one. It seems it was a typo from c9d522d. GLShader.fromSource takes one source, unlike GLProgram.fromSources which takes two sources.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the signature, now CI is failing with

Error: Incompatibilities between lime.graphics.opengl.GLShader in Android and HTML5 (could not merge definition)

should I change it back to dynamic or something?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I change it back to dynamic or something?

Yeah, that could be the reason

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think there was probably a reason it is Dynamic anyway, so it should probably be kept like that. However, it seems that's not why it was failing, and on second thought it's probably adding #if !lime_webgl that introduced this error. Maybe we actually want to mark fromInt as noDoc or something.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more specific? I'm not familiar with noDoc, I assume it's a meta? would I add it to the new method, or both

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also wrap this in #if haxe > version("4.3"), I suppose. I don't get why you would generate docs in old haxe versions, openfl.org doesn't seem to show apis for older versions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding that check around fromInt would just bring back the original error: has no field fromInt

To get the ci passing, we can change the haxe version here:
https://github.com/Geokureli/lime/blob/f8ba43823ed773c04f88b12603c79edbd739cefa/.github/workflows/main.yml#L733

Maybe we can just update the global version to haxe 4.3, unless there was a reason lime is sticking to 4.2 for now. Perhaps @joshtynjala might know?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding that check around fromInt would just bring back the original error: has no field fromInt

It would fix my issue with flixel-docs and anyone else using haxe 4.3. but yeah, let's find out

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall any particular reason for us to strictly stick to Haxe 4.2 instead of 4.3 for our default on CI. I think it's been working fine, so we haven't bothered updating. 4.3 has been out for a while now, and is also very stable, so it shouldn't cause issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I think we can change the global haxe version to 4.3.7 in this PR, which should make the docs ci job pass here.

Comment thread src/lime/graphics/opengl/GLShader.hx Outdated
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

Successfully merging this pull request may close these issues.

3 participants