-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fable 4 cannot recognize generic property type parameter, when it is not declared on the property explicitly #3248
Comments
dotnet/fsharp#12198 This is no longer allowed as it didn't make sense (produced invalid IL) in the first place. |
@kerams so that's me who is wrong, not Fable 4 - what a twist 🤔 And just because the issue has been fixed quite recently, I don't see the error in environments other than Fable 4 as I understand. So the problem relates only to inferred property parameters -- there is nothing wrong with explicitly set generic property parameters or inferred (implicit) generic method parameters, am I right? |
Properties may not be generic.
Fable 4 is using the bleeding edge version of FCS, so it includes the recent fix which prohibits generic properties. |
Then |
Hmm, I don't know. That should not work either in my opinion. It's basically the same thing. Doesn't work interface X
{
public T GetT<T> { get; }
} Works with a class-level generic type interface X<T>
{
public T GetT { get; }
} @vzarytovskii, thoughts? |
Yeah, explicit type parameters are definitely wrong. Just try it with |
Got it, @kerams, thank you for the clarification 👍 Most likely I wouldn't have discovered the true origin of the issue by myself any time soon. Seems like now it can be closed. |
Description
When a type has a property with implicit generic type parameter, Fable 4 reports an error
type parameter is not defined
. However F# compiler and Fable 3 handles compilation successfully.Repro code
Example code:
REPL link
Expected and actual results
In the example above the members
implicitlyGenericProperty1
andimplicitlyGenericProperty2
provokes the error while the other slightly different members doesn't. The expected behavior is to have the whole code being compiled successfully as it happens with regular F# compiler and Fable 3.Related information
The text was updated successfully, but these errors were encountered: