Last active
January 1, 2016 01:28
-
-
Save controlflow/8072635 to your computer and use it in GitHub Desktop.
Primary ctors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReverseForLookupItem : ForLookupItemBase | |
{ | |
public ReverseForLookupItem([NotNull] PrefixExpressionContext context, | |
[NotNull] LiveTemplatesManager templatesManager, | |
[CanBeNull] string lengthPropertyName) | |
: base("forR", context, templatesManager, lengthPropertyName) { } | |
protected override IForStatement CreateStatement(CSharpElementFactory factory, ICSharpExpression expression) | |
{ | |
... | |
} | |
} | |
// vs. | |
class ReverseForLookupItem([NotNull] PrefixExpressionContext context, | |
[NotNull] LiveTemplatesManager templatesManager, | |
[CanBeNull] string lengthPropertyName) | |
: ForLookupItemBase("forR", context, templatesManager, lengthPropertyName) | |
{ | |
protected override IForStatement CreateStatement(CSharpElementFactory factory, ICSharpExpression expression) | |
{ | |
... | |
} | |
} |
Author
controlflow
commented
Dec 31, 2013
Кажется, слишком наворочено. Поживём-увидим :о)
Так не работает
class Point(int x, int y) {
public int X { get { return x; } }
public int Y { get { return y; } }
}
(7,31): error CS9007: Parameters of a primary constructor can only be accessed in instance variable initializers and arguments to the base constructor.
(8,31): error CS9007: Parameters of a primary constructor can only be accessed in instance variable initializers and arguments to the base constructor.
Последние 3 примера не работают
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment