Compiler bug

looks like it’s confused about a generic?

Fire 2211


	let promise = Promise<NoParams>()

	blah.abc(
		onSuccess:
			{
				print("blah")
				promise.resolve(NoParams.instance).  //////////////<<<<<<
			},
		onFail:

on the marked line I get
Type mismatch, expected “Promise”

which is what I thought it was :frowning:
all the text is selected for the error

oh… I think this is just a weird message…
and it’s actually a byproduct of an error further up.
this can be closed.

1 Like

If you think the error reporting is bad, i’d still love to get a testcase so we can improve this.

thanx,
marc

public class ABC
{
private var xxx: XXX? // where XXX is NOT defined anywhere…

public func abc() -> Promise<NoParams>
{
            let promise = Promise<NoParams>()

	xxx?.initialise(
		onSuccess:
			{
				promise.resolve(NoParams.instance)
			},
		onFail:
			{
				promise.reject(PromiseError("VSE failed to initialise"))
	})

	return promise
    }

}